lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bamford <>
Subject Combining Wildcard and Term Queries?
Date Tue, 26 Aug 2008 15:08:14 GMT
Can you combine these two queries somehow so that they behave like a 

I have a custom query parser which takes a phrase like "*at sat" and 
produces a BooleanQuery consisting of a WildcardQuery ('*at') and a 
TermQuery ('sat').  This works, but matches more widely than expected 
(by me).

 "*at sat" will match any docs containing '*at' OR 'sat',   whereas
 "cat sat" will only match docs containing the exact phrase

I would like the latter behaviour if at all possible.

I have looked at SpanQuery, but I can't see how to use it in this case...

Any pointers happily received.

- Chris

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

View raw message