We are currently switching an application's search function over to Examine from umbSearch2. Some fields are more important than others, and some documents are given a "boost" value that makes them appear higher in the rankings. We are having trouble figuring out how to accomplish the latter using Examine and the standard indexers.
Would this require us to subclass ourselves a new indexer, or is there a more elegant solution? Examine's been nice to work with so far
Do you want to boost the terms when they go into the index, or when you're searching? The fluent API has extension methods in it that allows you to boost terms as you're searching.
For the terms, either is fine, but I'd also like to be able to apply a boost to certain documents as a whole (eg, make the pages that most people are trying to access show up higher, despite a lower search score under natural conditions). The original implementation might have been achieved by multiplying each term's 'boost' by some coefficient that varied by document (I don't currently have access to the original implementation's source.)
If you want to boost when something goes into the index then you'd need to create your own Indexer class and use that, Examine doesn't allow you to customize that OOTB. Well I suppose you could do it with the DocumentWriting event, but it'd be a bit of a tricky one to do IMO (and not something I've ever tried).
Easiest way should be to do it when searching, and you can do that by the extensions methods which come with Examine for the FluentAPI, and just do a search on the NodeTypeAlias and boost it.
which solves the ArgumentNullException, but prevents Examine from returning results. The same thing happens if I use Boost and Fuzzy in the other order. I am probably doing something wrong, but am not sure what that would be.
Examine Field / Document Boost
Hello,
We are currently switching an application's search function over to Examine from umbSearch2. Some fields are more important than others, and some documents are given a "boost" value that makes them appear higher in the rankings. We are having trouble figuring out how to accomplish the latter using Examine and the standard indexers.
Would this require us to subclass ourselves a new indexer, or is there a more elegant solution? Examine's been nice to work with so far
Thanks,
Chris
Do you want to boost the terms when they go into the index, or when you're searching? The fluent API has extension methods in it that allows you to boost terms as you're searching.
For the terms, either is fine, but I'd also like to be able to apply a boost to certain documents as a whole (eg, make the pages that most people are trying to access show up higher, despite a lower search score under natural conditions). The original implementation might have been achieved by multiplying each term's 'boost' by some coefficient that varied by document (I don't currently have access to the original implementation's source.)
If you want to boost when something goes into the index then you'd need to create your own Indexer class and use that, Examine doesn't allow you to customize that OOTB.
Well I suppose you could do it with the DocumentWriting event, but it'd be a bit of a tricky one to do IMO (and not something I've ever tried).
Easiest way should be to do it when searching, and you can do that by the extensions methods which come with Examine for the FluentAPI, and just do a search on the NodeTypeAlias and boost it.
I did end up doing that, and the boost is working now -- thank you.
I am now running into another issue, though - how can I combine Fuzzy with Boost? I'm trying to do:
but am getting an ArgumentNullException on s. I also tried
which solves the ArgumentNullException, but prevents Examine from returning results. The same thing happens if I use Boost and Fuzzy in the other order. I am probably doing something wrong, but am not sure what that would be.
Has anyone been able to get fuzzy and boost to work together? I works when testing in Luke.
is working on a reply...