3

我正在尝试使用 solr 从我的数据库中索引数据。索引数据后,当我查询 *.* 时,我只得到结果中的 id 字段。不是我查询中的所有字段。

我的数据-config.xml

<document name="content">
    <entity name="documen" query="SELECT indexId ,brand_id, category_id, product_name from Production">
        <field column="indexId" name="id" /> 
        <field column="category_id" name="categoryid" />
        <field column="brand_id" name="brandid" />
        <field column="product_name" name="id" />
    </entity>
</document>

我的 schema.xml 看起来像这样:

<field name="id" type="int" indexed="true" stored="true" required="true"/>
<field name="categoryid" type="int" indexed="true" stored="true"/> 
<field name="brandid" type="int" indexed="true" stored="true" />
<field name="productname" type="string" indexed="true" stored="true"/>

当我使用我查询*.*

<doc>
<str name="id">1</str>
<long name="_version_">1426653005792411648</long></doc>
<doc>
<str name="id">2</str>
<long name="_version_">1426653005793460224</long></doc>
<doc>

结果我只得到“id”字段。

实际上,“uniquekey”标签中的任何字段都会作为查询结果返回

4

0 回答 0