Copied to clipboard

Flag this post as spam?

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


  • Tom Steer 161 posts 596 karma points
    Jan 27, 2014 @ 14:31
    Tom Steer
    0

    Examine Boosting field in GroupedOr

    Hello,

    I was wondering if anyone knew how to use the Boost feature in Examine. I've tried a couple of things now but failed to get it working.

    if (filter == null) { filter = criteria.GroupedOr(new string[] { "nodeName", "title", "sku", "description", "shortDescription", "headerText", "bodyText" }, SearchArray[i].MultipleCharacterWildcard()); } else { filter = filter.And().GroupedOr(new string[] { "nodeName", "title", "sku", "description", "shortDescription", "headerText", "bodyText" }, SearchArray[i].MultipleCharacterWildcard()); }

    I'm trying to boost the "title" field.

    Many Thanks,

    Tom

  • Tom Steer 161 posts 596 karma points
    Jan 30, 2014 @ 09:15
    Tom Steer
    0

    Any advice would be grateful?

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 30, 2014 @ 09:33
    Ismail Mayat
    0

    Tom,

    Not sure you can boost individual field in grouped clause. You can however create your own raw sql of the grouped or and boost just on title field. So as part of your query you would have

    (title:foo)^1.5

    Then in examine do rawquery.

    Regards

    Ismail

  • Tom Steer 161 posts 596 karma points
    Jan 30, 2014 @ 09:40
    Tom Steer
    0

    Hi Ismail,

    Thanks for the advice :) I will research the raw query and give that route a try.

    Many Thanks,

    Tom

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 30, 2014 @ 10:49
    Ismail Mayat
    0

    Tom,

    You could still build up main query as you already have it and then to criteria.ToString() this will give you lucene querystring that examine has generated. You can then do some string manipulation on it to do the title boost. Its a bit messy but can be done rather than build up the whole query string from scratch.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft