> It looks good to me, but I did not test, when testing, we may print out both
>
> initialQuery.toString() // query produced by QueryParser
> finalQuery.toString() // query after your new function
>
> as comparison, besides testing the query result.
Yes - it's exactly what I wanted:
Test Input
-
From: Christopher Condit [mailto:con...@sdsc.edu]
Sent: Friday, April 30, 2010 4:06 PM
To: java-user@lucene.apache.org
Subject: RE: Modify TermQueries or Tokens
> 2) if I have to accept whole input string with all logic (AND, OR, ..) inside,
>I think it is easier to change TermQuery afte
> 2) if I have to accept whole input string with all logic (AND, OR, ..) inside,
>I think it is easier to change TermQuery afterwards than parsing the
> string,
>since final result from query parser should be BooleanQuery (in your
> example),
>then we iterate through each BooleanClause
have not done that myself before, but feel it should work.
Best regards, Lisheng
-Original Message-
From: Christopher Condit [mailto:con...@sdsc.edu]
Sent: Friday, April 30, 2010 2:08 PM
To: java-user@lucene.apache.org
Cc: Zhang, Lisheng
Subject: RE: Modify TermQueries or Tokens
Hi Li
Hi Lisheng-
>> 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
rked for me well.
Best regards, Lisheng
-Original Message-
From: Zhang, Lisheng [mailto:lisheng.zh...@broadvision.com]
Sent: Friday, April 30, 2010 1:41 PM
To: java-user@lucene.apache.org
Subject: RE: Modify TermQueries or Tokens
Hi,
Lucene already have class WildcardQuery, I think
-
From: Christopher Condit [mailto:con...@sdsc.edu]
Sent: Friday, April 30, 2010 1:11 PM
To: java-user@lucene.apache.org
Subject: Modify TermQueries or Tokens
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 reali
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