1
我的數據導入處理程序文件低於:如何使用數據導入處理程序和模式插入Solr中嵌套數據
<document>
<entity name="product" query="SELECT
id,
sku,
name,
image FROM products">
<field column="id" name="id" />
<field column="sku" name="sku" />
<field column="name" name="name" />
<field column="image" name="image" />
<entity name="rates" child="true" query="select start_date, end_date, price from product_rates where product_id='${product.id}'">
<field name="start_date" column="start_date" />
<field name="end_date" column="end_date" />
<field name="price" column="price" />
</entity>
</entity>
</document>
當我設置的孩子=帶小孩數據未插入到Solr真正的文件。我需要架構或solrconfig中的任何更改來插入子文檔。 我使用Solr的6.3和我的schema.xml低於:
<schema name="product" version="1.5">
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="_root_" type="string" indexed="true" stored="false"/>
<!--PARENT DOC-->
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="sku" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="name" type="text_general" indexed="false" stored="true" multiValued="false" />
<field name="image" type="text_general" indexed="false" stored="true" multiValued="false" />
<!--CHILD DOC-->
<field name="start_date" type="date" indexed="false" stored="true" multiValued="false" />
<field name="end_date" type="date" indexed="true" stored="true" multiValued="false" />
<field name="price" type="tdouble" indexed="true" stored="true" multiValued="false" />
<uniqueKey>id</uniqueKey>
<defaultSearchField>id</defaultSearchField>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" />
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<fieldType name="currency" class="solr.CurrencyField" precisionStep="8" defaultCurrency="USD" currencyConfig="currency.xml" />
</schema>