On Oct 28, 2005, at 10:38 AM, Erik Hatcher wrote:
So in this case a matching document must have both terms? Or could it just have one or the other? If it must have both, you could try a PhraseQuery with a slop of Integer.MAX_VALUE. PhraseQuery scores closer matches higher.

Good to know, thanks. I saw references to slop but didn't know what they meant. I'll see if this is one way I could solve my problem.

But as Chris suggested - check the IndexSearcher.explain() for some documents you feel should be ranked higher and work from there. You're on the right track, but some tuning appears necessary.

Okay, I looked at the explanations and realized part of the problem was that I was applying a sort field to the search results, which I had forgotten. So of course that affected the display order, duh. But I also do need to do some tuning, because I'm adding other stuff to the query that is also skewing the ranking.

It took me a while to figure out the differences between the searcher.explain() example in LIA and the latest changes to the API. It was a little annoying that I couldn't find a way to get plain text output -- it seems to be only HTML now. Finally I wrote a convenience method that dumps the HTML to a file, which I view in a browser.

Thanks, Chris and Erik!

--Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to