Copied to clipboard

Flag this post as spam?

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


  • Mihail 39 posts 142 karma points
    Sep 22, 2016 @ 12:17
    Mihail
    0

    Search by exact words in a phrase using Umbraco Examine

    Hi,

    I have some description field per content and those are:

    For content1:

    The quick brown fox jumps over the lazy dog. And the lazy dog is good.

     

    For content2:

    The lazy fog is crazy.

    Now, when I use keyword = lazy dog, I want to give result as content1 and not content2

    I tried like:

    BaseSearchProvider searcher = ExamineManager.Instance.SearchProviderCollection["MySearch"];
    ISearchCriteria criteria =
                searcher.CreateSearchCriteria()
                   .GroupedAnd( new List<string> { "description" }, "lazy dog") )
                   .Compile();
    
    ISearchResults result = searcher.Search( criteria );
    

    But it didn't gave me desired results, it give me results: content1 and content2.

    What should I do in order to get as content1 result ?

Please Sign in or register to post replies

Write your reply to:

Draft