[英]Lucene search creteria change the word
I use lucene for searching. 我使用lucene搜索。
For each doc in index I have some field called "uniqueIdentifier" with type string. 对于索引中的每个文档,我都有一个名为string的字段,称为“ uniqueIdentifier”。
When I want to find all items with "uniqueIdentifier" == "haaglanden", I use the next code: 当我想查找所有带有“ uniqueIdentifier” ==“ haaglanden”的商品时,我使用下面的代码:
var searcher = Examine.ExamineManager.Instance.SearchProviderCollection["RegionsSearcher"];
var searchCriteria = searcher.CreateSearchCriteria(BooleanOperation.And);
var temp = searchCriteria.RawQuery("+uniqueIdentifier:" + uniqueIdentifier);
In temp I see : 在临时我看到:
LuceneQuery: {+(+uniqueIdentifier:haagland)}
But " haagland " != " haaglanden ". 但是“ haagland ”!=“ haaglanden ”。
And I can not find my docs. 而且我找不到我的文档。
How can I build query with "haaglanden"? 如何使用“ haaglanden”构建查询?
The cause was in analyzer. 原因是在分析仪中。
Swiched Lucene.Net.Analysis.Nl. 夹式Lucene.Net.Analysis.Nl。 DutchAnalyzer to Lucene.Net.Analysis.Standard. 适用于Lucene.Net.Analysis.Standard的DutchAnalyzer 。 StandardAnalyzer . StandardAnalyzer 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.