Copied to clipboard

Flag this post as spam?

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


  • Rob Watkins 369 posts 701 karma points
    Sep 20, 2018 @ 11:15
    Rob Watkins
    0

    Examine - boosting results

    I have a fairly complicated Examine query using the fluent API; it is all working, but the client wants to have certain results always higher in the results order.

    I have added a priority field to the document type, but I can't work out how to simply boost using this rather than using it in the criteria - so e.g. I can't use an And().Field() to boost, because it can't be used in filtering - just ordering.

    Is there a way of doing this? Or do I need to just post-order the results?

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Sep 21, 2018 @ 23:55
    Marc Goodson
    0

    Hi Rob

    You could capture the documentwriting event, and boost certain results at the time of creating the index, using e.Document.SetBoost() - there is a good write up here:

    https://thecogworks.com/blog/posts/examiness-hints-and-tips-from-the-trenches-part-3-umbraco-examine/

    if that's what you are describing?

    regards

    Marc

  • Bernard Moes 16 posts 138 karma points
    Sep 22, 2018 @ 09:13
    Bernard Moes
    0

    Rob, do you want to boost a document type by the value entered in the priority field on your document type? You could read out the property value in the documentwriting event like Marc just described, and boost the whole document based on that value.

Please Sign in or register to post replies

Write your reply to:

Draft