这就是我的 schema.xml 中的内容:
<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="about" type="string" indexed="true" stored="true" />
<field name="music" type="string" indexed="true" stored="true" />
<field name="movies" type="string" indexed="true" stored="true" />
<field name="occupation" type="string" indexed="true" stored="true" />
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
</fields>
<uniqueKey>id</uniqueKey>
这是我发布的文档:
<add>
<doc>
<field name="id">abc123</field>
<field name="about">I am somebody</field>
<field name="music">pop</field>
<field name="movies">titanic</field>
<field name="occupation">web dev</field>
</doc>
</add>
文档被推送到 Solr 就好了,当我使用 Solr Admin 搜索时,*:*
它显示我的文档如下:
<?xml version="1.0" ?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
<lst name="params">
<str name="indent">on</str>
<str name="start">0</str>
<str name="q">*:*</str>
<str name="version">2.2</str>
<str name="rows">10</str>
</lst>
</lst>
<result name="response" numFound="1" start="0">
<doc>
<str name="about">I am somebody</str>
<str name="id">abc123</str>
<str name="movies">titanic</str>
<str name="music">pop</str>
<str name="occupation">web dev</str>
</doc>
</result>
</response>
但是,当我使用文档中明确包含的关键字(例如“titanic”或“web”)进行搜索时,没有结果显示:
<?xml version="1.0" ?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
<lst name="params">
<str name="indent">on</str>
<str name="start">0</str>
<str name="q">titanic</str>
<str name="version">2.2</str>
<str name="rows">10</str>
</lst>
</lst>
<result name="response" numFound="0" start="0"/>
</response>
如何解决这个问题?