Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jaison 8 posts 79 karma points
    Aug 04, 2023 @ 13:29
    Jaison
    0

    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.

  • Huw Reddick 1929 posts 6717 karma points MVP 2x c-trib
    Aug 04, 2023 @ 15:11
    Huw Reddick
    1

    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

    options.Analyzer = new StandardAnalyzer(LuceneVersion.LUCENE_48, CharArraySet.EMPTY_SET);
    
Please Sign in or register to post replies

Write your reply to:

Draft