lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Range query and a proximity search
Date Tue, 21 Jul 2009 07:59:21 GMT

> Can you please suggest me some pointers as to how a range
> query combined with proximity be done.

Your remedy is ComplexPhraseQueryParser that utilizes SpanQuery family.
That accepts ranges, ORs, Wildcards inside Phrase queries.

Using this new QueryParser your query will be someting like.
(with the default field set to contents) 

"revision [40 TO 50]"

If you want to construct your Query programmatically with Lucene Query API:

Query query = spanNear([contents:revision, spanOr([contents:40, contents:41, ..., contents:50])],
0 , true)

Take a look at those Query subclasses:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message