On Wednesday 11 January 2006 11:33, Eric Jain wrote:
> Paul Elschot wrote:
> > One way that might be better is to provide your own Scorer
> > that works on the term positions of the three or more terms.
> > This would be better for performance because it only uses one
> > term positions object per query term (a, b, and c here).
> 
> I'm trying to extract the actual phrases, rather than scoring documents 
> with terms that appear in the same order higher (though that would seem 
> like a good idea, too).
> 
> The idea is that once I have the phrases, I can suggest something like 
> "show only matches where a and b appear next to each other". Not terribly 
> important, but if there was a simple and efficient way to accomplish this...

If you can express each phrase as a SpanNearQuery, the occurrences
of the phrases can be easily obtained by iterating over the result of
getSpans() on SpanNearQuery.
It's not as efficient as a specialized PhraseQuery, though.

Regards,
Paul Elschot.

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

Reply via email to