[英]Solr removing the 'e' from ace001 search term
Solr正在從搜索查詢中刪除字母“ e” ...
關於Solr我是一個新手,所以我真的不知道從哪里開始尋找答案,但是每當我發送搜索查詢時,Solr就會刪除'e'字符...
如您所見,當我嘗試搜索ace001
{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"q": "_text:ace001",
"indent": "true",
"wt": "json",
"debugQuery": "true",
"_": "1478467316690"
}
},
"response": {
"numFound": 0,
"start": 0,
"docs": []
},
"debug": {
"rawquerystring": "_text:ace001",
"querystring": "_text:ace001",
"parsedquery": "PhraseQuery(_text:\"ac 001 ac 001\")",
"parsedquery_toString": "_text:\"ac 001 ac 001\"",
"explain": {},
"QParser": "LuceneQParser",
"timing": {
"time": 1,
"prepare": {
"time": 1,
"query": {
"time": 1
},
"facet": {
"time": 0
},
"mlt": {
"time": 0
},
"highlight": {
"time": 0
},
"stats": {
"time": 0
},
"spellcheck": {
"time": 0
},
"debug": {
"time": 0
}
},
"process": {
"time": 0,
"query": {
"time": 0
},
"facet": {
"time": 0
},
"mlt": {
"time": 0
},
"highlight": {
"time": 0
},
"stats": {
"time": 0
},
"spellcheck": {
"time": 0
},
"debug": {
"time": 0
}
}
}
}
}
搜索諸如“ acb001”之類的不同術語不會去除“ b”,但我注意到它確實將數字和字母分開。 我希望Solr在文本字段中匹配術語“ acb001” ...
提取:
"rawquerystring": "_text:acb001",
"querystring": "_text:acb001",
"parsedquery": "PhraseQuery(_text:\"acb 001 acb 001\")",
"parsedquery_toString": "_text:\"acb 001 acb 001\"",
"explain": {},
"QParser": "LuceneQParser",
在此,我將非常感謝您提供有關如何進一步調試或理想地修復此問題的指導,以便ace001返回所有出現的情況。
編輯:
架構為標准/默認http://pastebin.com/59LbmJUp
這是因為solr.PorterStemFilterFactory。 您的默認搜索字段ID為htmltext,其中包含
<filter class="solr.PorterStemFilterFactory"/>
在查詢分析中。
PorterStemmer將“ ace”一詞改為“ ac”。 您可以在這里https://tartarus.org/martin/PorterStemmer/voc.txt進行搜索,以搜索“ ace”一詞。 現在在這里查看在阻止https://tartarus.org/martin/PorterStemmer/output.txt之后具有相應的輸出,阻止之后的對應單詞將為“ ac”
解決此問題在查詢過程中過濾器以及solrconfig.xml中的索引
另外,您正在使用WordDelimiterFilterFactory ,它將在字母數字邊界上分割單詞。 這就是為什么看到“ ac”和“ 001”的原因,如果您不想這樣做,也可以在schema.xml中刪除該過濾器
您使用的是默認schema.xml,其中包含許多甚至可能不需要的不必要的過濾器。 我建議將其簡化為幾個過濾器。 然后根據需要添加過濾器,而不是其他方式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.