I'm not sure what you're trying to do, but it seems to me that your best bet is to rewrite the query returned from the QueryParser. Just traverse the BooleanQuery clauses, converting any TermQuery to a WildcardQuery. You can then have control over what transformation exactly you want to perform.
Israel On Thu, Nov 18, 2010 at 5:36 PM, Pulkit Singhal <pulkitsing...@gmail.com>wrote: > Hello, > > I was wondering if there is any API call in Lucene that allows > something like the following: > > Step 1: Take the user input > "hello world" you are beautiful > > Step 2: QueryParser does its thing > defaultField:hello world defaultField:you defaultField:are > defaultField:beautiful > > Step 3: And somehow a desired transformation like the following one is > the next thing to happen: > defaultField:hello world defaultField:you* defaultField:are* > defaultField:beautiful* > > How can I tell QueryParser to throw in the wildcard "*" expression > where applicable? > > You can see that I'm not expecting it to use "*" with something that > will turn into a phrase query: > "hello world" becomes defaultField:hello world > Just the rest of the tokens: > defaultField:you* defaultField:are* defaultField:beautiful* > > Thanks! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >