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
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.
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
Any advice would be grateful?
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
Hi Ismail,
Thanks for the advice :) I will research the raw query and give that route a try.
Many Thanks,
Tom
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
is working on a reply...