lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject SpanNearQuery vs. PhraseQuery.setSlop
Date Mon, 22 Aug 2011 22:18:15 GMT
We are using phrase queries with a slop value to perform Near and Within style searches and
the issue we are encountering is as follows:

Since the slop value in the PhraseQuery is the edit-distance, a message with the terms  'thank'
and 'you' will be found with a query of field:"thank you"~1 but will not be found with a query
of field:"you thank"~1. Currently to work around this nuance I am creating a new query of
field:("you thank"~1 OR "thank you"~1).

Can I solve this by constructing a SpanNearQuery with two SpanTermQuery("thank") and SpanTermQuery("you")
and a slop value of 1 and the ordering of false?

Ian Koelliker

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message