如何修改搜索能夠擊中我的searchString?Umbraco Lucene搜索自動完成
我有變量具有以下值:
fieldName: nodeName
searchString: des
我希望能夠在任何連續的字符,找到一個節點名稱:例如通過輸入design
找到Esa selects Ariane 6 basic design
。
我目前的搜索被構造爲:
var searchCriteria = SearchProvider.CreateSearchCriteria(BooleanOperation.Or);
var luceneString = string.Format("{0}:", fieldName);
luceneString += "(+" + searchString.Replace(" ", " +") + ")^10 ";
luceneString += string.Format("{0}:{1}", fieldName, searchString);
var rawQuery = searchCriteria.RawQuery(luceneString).Field(fieldName, searchString.Fuzzy(0.8f));
我檢查的定義:
<add name="AutoCompleteLookupIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
supportUnpublished="true"
supportProtected="true"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" />
該分析儀是您使用?標準,空格都應該工作 – naresh
@naresh是的,看我更新的問題 – cpoDesign