lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bamford <chris.bamf...@scalix.com>
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 
PhraseQuery?

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).

e.g. 
 "*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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message