On Wed, 18 Aug 2010, Aric Coady wrote:
Your python example differs from the java example. The java one uses the call
that's commented out:
#query = queryParser.parse(queryString)
query = queryParser.parse(Version.LUCENE_CURRENT, queryString, fields,
[BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD],
analyzer)
The problem is that the second form is a static method, so settings on the
parser object won't affect anything. Try it this way to reproduce the error:
query = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, queryString, fields,
[BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD],
analyzer)
You should see the same behavior in java lucene.
Whenever there is a name conflict between a static and non-static method
detected by JCC, the static method wrapper is renamed to be suffixed with a
'_' and a warning is emitted by JCC.
Does changing the code to use a parse_() method instead solve the problem ?
(it's late here and I haven't tried it myself)
Andi..
On Aug 18, 2010, at 5:21 AM, Christoph Burgmer wrote:
Hi Andy,
here's a short example in both Java and Python that do the same. The Python
example raises the error as mentioned by Daniel. I've also added a patch to
extend the current test cases to include tests for setAllowLeadingWildcard().
-Christoph
<LeadingWildcardExample.java><LeadingWildcardExample.py><leadingwildcard_test.patch>