Examine search not returning results for keywords in stopWords
Hi,
Umbraco is a new world for me.
My issue is that have created a small website in Umbraco Cms version 11.3.1.
below the code I have implemented for search functionality in front end,
var examingManager = ExamineManager.TryGetIndex("ExternalIndex", out IIndex? index);
var results = index.Searcher.CreateQuery("content").ManagedQuery(SearchText).And()
.GroupedOr(new[] { "__NodeTypeAlias" }, new[] {"docTypeAlias1","docTypeAlias2","docTypeAlias3"})
.Execute();
where "docTypeAlias1","docTypeAlias2","docTypeAlias3" are the document types whose conten1t are needed to be fetched and displayed in the search result.
Im getting results, but for the basic keywords like 'A', 'There', 'will' etc, the search does not return any result. On further investigation we were able to notice that Umbraco/ Lucene has the set of stop words defined due to which it was not returning the result.
Examine search not returning results for keywords in stopWords
Hi,
Umbraco is a new world for me.
My issue is that have created a small website in Umbraco Cms version 11.3.1.
below the code I have implemented for search functionality in front end,
var examingManager = ExamineManager.TryGetIndex("ExternalIndex", out IIndex? index); var results = index.Searcher.CreateQuery("content").ManagedQuery(SearchText).And() .GroupedOr(new[] { "__NodeTypeAlias" }, new[] {"docTypeAlias1","docTypeAlias2","docTypeAlias3"}) .Execute();
where "docTypeAlias1","docTypeAlias2","docTypeAlias3" are the document types whose conten1t are needed to be fetched and displayed in the search result.
Im getting results, but for the basic keywords like 'A', 'There', 'will' etc, the search does not return any result. On further investigation we were able to notice that Umbraco/ Lucene has the set of stop words defined due to which it was not returning the result.
Has anyone faced this issue and able to solve it?
Thanks.
Hi Jaison,
I think you should be able to do it using the approach detailed here
https://docs.umbraco.com/umbraco-cms/reference/searching/examine/indexing#creating-a-configureoptions-class
and adding the following code to the configure method
is working on a reply...