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?
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:
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.
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?
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
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.
is working on a reply...