lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Condit <>
Subject Modify TermQueries or Tokens
Date Fri, 30 Apr 2010 20:10:32 GMT
On a small index that I have I'd like to query certain fields by adding wildcards on either
side of the term: foo -> *foo*. I realize the performance implications but there are some
cases where these terms are crammed together in the indexed content (ie foonacho)  and I need
to be able to return this result when searching for foo or when searching for nacho. I'm curious
what the best way to modify the TermQuery object is. I thought about doing it directly on
the token as it gets parsed, but getNextToken() is final. Then I thought I could iterate over
the TermQueries under the returned Query and change their term, but there's no setTerm method.
Is the only way to do this by modifying the query string? Or is there some more elegant way
to modify the terms in a Query object? Something else I haven't considered?


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

View raw message