[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    RE: Proximity searching and phrase
From:       "Lucene" <Lucene () roylip ! ftech ! net>
Date:       2004-07-30 14:33:02
Message-ID: 6A0D1706A950884C952D27EB1654773402E9C6 () vulcan ! infonic ! com
[Download RAW message or body]

Thanks!

-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
Posted At: 30 July 2004 15:29
Posted To: Lucene
Conversation: Proximity searching and phrase
Subject: Re: Proximity searching and phrase


On Jul 30, 2004, at 7:01 AM, Lucene wrote:
> I was wondering is there is a way to do proximity searches with 
> phrases eg "very good" NEAR "sometimes".
>
> Any help on this would be welcome.

You can do this with the new SpanQuery family in v1.4.  The example you 
gave would consist of a SpanTermQuery for "very", "good", and 
"sometimes", with the first two combined with a SpanNearQuery (with no 
slop, in order), and finally the "very good" SpanNearQuery combined 
with another SpanNearQuery with the "sometimes" SpanTermQuery.  *whew* 
:)

There is no QueryParser support (yet) for such constructs, so doing 
this with the API directly is necessary.  There has been a contribution 
of a new parser that can work with SpanQuery which probably should be 
put in the sandbox soon.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic