> do a search on "Term 1" AND "Term 2" > do a search on "Term 2" AND "Term2" AND "Term 3" > > This would ensure that you have two objects back, one of which is > guaranteed to be a subset of the other.
I did start doing this after sending the email. My only concern is search speed. Right now I first search for "Term 1" OR "Term 2" and then if there are hits, I search for all three terms again on the whole index. I guess it is working just fine for me, but I wonder if I could speed it up at all by only searching on a subset of documents from the first search and the combining the hits to process later. > Then, when you are iterating on your documents to do your highlighting over > the results from the first search (At least I think that's what you are > doing here) check to see if the current document exists in the hits or > topDocs object that came from the second search. If it does, use the three > term highlighter, if it doesn't use the two term highlighter. > > But, what sort of reordering are you trying to do here anyhow? I am doing a weighting system where I rank documents that have Term 1 AND Term 2 AND Term 3 more highly than documents that have just Term 1 AND Term 2, and more highly than documents that just have Term 1 OR Term 2 but not both. Thanks, Max