Solr Index appears to be valid - but returns no results

时光总嘲笑我的痴心妄想 提交于 2019-11-27 16:08:00

问题


Solr newbie here.

I have created a Solr index and write a whole bunch of docs into it. I can see from the Solr admin page that the docs exist and the schema is fine as well. But when I perform a search using a test keyword I do not get any results back.

  1. On entering * : *

    into the query (in Solr admin page) I get all the results.

  2. However, when I enter any other query (e.g. a term or phrase) I get no results. I have verified that the field being queried is Indexed and contains the values I am searching for.

So I am confused what I am doing wrong.


回答1:


Probably you don't have a <defaultSearchField> correctly set up. See this question.

Another possibility: your field is of type string instead of text. String fields, in contrast to text fields, are not analyzed, but stored and indexed verbatim.




回答2:


With solr 4, I had to solve this as per Mauricio's answer by defining type="text_en" to the field.




回答3:


With solr 6, use text_general.



来源:https://stackoverflow.com/questions/3493499/solr-index-appears-to-be-valid-but-returns-no-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!