Solr管理界面分析结果与solr搜索结果不匹配
Solr 中有 6 个带有文本字段“name_texts”的索引文档。当字段值为“blue-cat”并且搜索词为“blueCat”时,管理 UI 会突出显示字段值。但搜索查询返回 0 个结果。为什么会出现这种情况?
http://localhost:8982/solr/select?q=name_texts:blueCat
<response>
<lst name= "responseHeader">
<int name= "status">0</int>
<int name= "QTime">2</int>
<lst name= "params">
<str name= "q">name_texts:blueCat</str>
</lst>
</lst>
<result name= "response" numFound= "0" start= "0" />
</response>
http://localhost:8982/solr/select?q=*:*
<response>
<lst name= "responseHeader">
<int name= "status">0</int>
<int name= "QTime">2</int>
<lst name= "params">
<str name= "q">*:*</str>
</lst>
</lst>
<result name= "response" numFound= "6" start= "0">
<doc>
<str name= "id">Track 106216</str>
<arr name= "name_texts">
<str>blue-cat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106217</str>
<arr name= "name_texts">
<str>Blue_cat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106218</str>
<arr name= "name_texts">
<str>blueCat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106219</str>
<arr name= "name_texts">
<str>blue_cat1</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106220</str>
<arr name= "name_texts">
<str>BlueCat4</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106221</str>
<arr name= "name_texts">
<str>blue-Cat45</str>
</arr>
</doc>
</result>
</response>
这是一个schema.xml
<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="0"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.TrimFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory"
minGramSize="2"
maxGramSize="25" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1"
generateNumberParts="1"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.TrimFilterFactory" />
</analyzer>
There are 6 indexed document in Solr with the text field "name_texts". The Admin UI highlights field value when it is "blue-cat" and the search term is "blueCat". But the search query returns 0 results. Why that happens ?
http://localhost:8982/solr/select?q=name_texts:blueCat
<response>
<lst name= "responseHeader">
<int name= "status">0</int>
<int name= "QTime">2</int>
<lst name= "params">
<str name= "q">name_texts:blueCat</str>
</lst>
</lst>
<result name= "response" numFound= "0" start= "0" />
</response>
http://localhost:8982/solr/select?q=*:*
<response>
<lst name= "responseHeader">
<int name= "status">0</int>
<int name= "QTime">2</int>
<lst name= "params">
<str name= "q">*:*</str>
</lst>
</lst>
<result name= "response" numFound= "6" start= "0">
<doc>
<str name= "id">Track 106216</str>
<arr name= "name_texts">
<str>blue-cat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106217</str>
<arr name= "name_texts">
<str>Blue_cat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106218</str>
<arr name= "name_texts">
<str>blueCat</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106219</str>
<arr name= "name_texts">
<str>blue_cat1</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106220</str>
<arr name= "name_texts">
<str>BlueCat4</str>
</arr>
</doc>
<doc>
<str name= "id">Track 106221</str>
<arr name= "name_texts">
<str>blue-Cat45</str>
</arr>
</doc>
</result>
</response>
This is a schema.xml
<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1"
generateNumberParts="1"
catenateWords="1"
catenateNumbers="1"
catenateAll="0"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.TrimFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory"
minGramSize="2"
maxGramSize="25" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1"
generateNumberParts="1"
catenateWords="0"
catenateNumbers="0"
catenateAll="0"
preserveOriginal="1"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.TrimFilterFactory" />
</analyzer>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的查询对于您的数据来说不好!
我可以请您尝试一下:
给我一些反馈! :)
I think that your query is not good regarding to your datas !
May I ask you to give a try like this :
Give me some feedback! :)