Copied to clipboard

Flag this post as spam?

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


  • Tom 133 posts 223 karma points
    Dec 14, 2018 @ 19:19
    Tom
    1

    Hello:

    I am on Umbraco v7.11.1. I have successfully created three string builder objects that I have added to Examine search index. They are as follows: (sb-title) for PDF Title /Content Page Title/Word document titles.
    (sb-body) for PDF content/Content/Word document content. (sb-metadata) for PDF description/content description/Word document content. Note: I used the GatheringNode event handler to perform this action.

    I then used "LUKE jar executable" to search content in each index and I have been able to search and get results from LUKE. All is well!

    Now I am on to the search results code.

    What I would like to do is add boosting 4.0 to the index sb-title field if what's being searched is found in the sb-title field.

    What I would like to do is add boosting 3.0 to the index sb-body field if what's being searched is found in the sb-body field.

    What I would like to do is add boosting 2.0 to the index sb-meta field if what's being searched is found in the sb-meta field.

    Does anyone have an example of how to do this?

    Thanks

    BTD

  • Søren Gregersen 282 posts 1138 karma points MVP c-trib
    Dec 15, 2018 @ 07:50
    Søren Gregersen
    1

    Have a look at this blogpost: https://umbraco.com/blog/examining-examine/

    Basically you use Boost in the Fluent API

  • Tom 133 posts 223 karma points
    Dec 17, 2018 @ 17:55
    Tom
    0

    Thank you so much for your reply.

    Tom

  • Tom 133 posts 223 karma points
    Dec 26, 2018 @ 11:26
    Tom
    0

    Seren:

    Thanks for the link.
    I am now using the Fluent API to boost.

            var Searcher = ExamineManager.Instance.SearchProviderCollection[searchProvider];
            var searchCriteria = Searcher.CreateSearchCriteria(BooleanOperation.Or);
            var query = searchCriteria.Field("fhlb-Title", searchTerm.Boost(5)).Or().Field("fhlb-Body", searchTerm.Boost(3)).Or().Field("fhlb-Metadata", searchTerm.Boost(2)).Compile();
    

    var searchResults = Searcher.Search(query);

    searchResults now contains the results "boosted". Note: For my implementation I have 3 buckets to hold my search results ("fhlb-Title", fhlb-Body" and fhlb-Metaqdata")

    But now I need additional help in returning the results to the User Interface and in highlighting what's searched.

    Do you have an extended example that will highlight searched text and also show a 2-3 line headline of each search result?

    Thanks

    Tom

    PS I verified my searching is working using LUKE.

  • Tom 133 posts 223 karma points
    Dec 26, 2018 @ 11:27
    Tom
    0

    If you need more code, let me know and I can post my code process.

    Thanks Tom

Please Sign in or register to post replies

Write your reply to:

Draft