当我在查询中包含一个字段时,我只能让Solr工作,例如:
http://localhost:8983/solr/collection1/select?q=lastname:johnson
Run Code Online (Sandbox Code Playgroud)
上面的查询返回大约18个结果.
如果不指定字段,是否应该可以使用Solr(/ Lucene)?如:
http://localhost:8983/solr/collection1/select?q=johnson
Run Code Online (Sandbox Code Playgroud)
我还尝试添加字段列表:
http://localhost:8983/solr/collection1/select?q=johnson&fl=cus_id%2Cinitials%2Clastname%2Cpostcode%2Ccity
Run Code Online (Sandbox Code Playgroud)
但所有这些查询都返回零结果.
这些是我的schema.xml中的字段:
<field name="cus_id" type="string" indexed="true" stored="true"/>
<field name="initials" type="text_general" indexed="true" stored="true" />
<field name="lastname" type="text_general" indexed="true" stored="true"/>
<field name="postcode" type="string" indexed="true" stored="true" />
<field name="city" type="text_general" indexed="true" stored="true"/>
Run Code Online (Sandbox Code Playgroud)
我不知道还有什么可以尝试的.有什么建议?