Hi, I'm not sure the query parser can support what you ask for, but you can achieve this in code very easily by using SpanNearQuery. Define each term as SpanTermQuery, then use SpanNearQuery with slop=0 for phrases and add these queries to another SpanNearQuery with slop = 3/4 etc.
Hope this helps, Eran. On Mon, Jan 18, 2010 at 4:13 PM, T. R. Halvorson <[email protected]> wrote: > For proximity expressions, the query parser documentation says, "use the > tilde, "~", symbol at the end of a Phrase." It gives the example "jakarta > apache"~10 > > Does this mean that proximity can only be operated on single words enquoted > in quotation marks? To clarify the question by comparision, on some systems, > the w/ proximity operator lets one search for: > > crude w/4 "west texas" > > or > > "spot prices" w/3 "gulf coast" > > The Lucene documentation seems to imply that such searches cannot be > constructed in any straightforward way (although there might be a way to get > the effect by going around Cobb's Hill). Or does the Lucene syntax allow the > examples to be cast as: > > "crude "west texas""~4 > > or > > ""spot prices" "gulf coast""~3 > > Thanks in advance for any help with this. > > T. R. >
