This is because phrases are expected to contain >1 clause and the
ComplexPhraseQueryParser was expecting a BooleanQuery from the base class
which is used to hold the elements in the phrase.
In this single-clause scenario I guess we could silently hide the error and
return whatever single query clause was inappropriately found between the
quotes.
On 19 Feb 2010, at 19:53, David Kaelbling wrote:
> Hi,
>
> ComplexPhraseQueryParser doesn't appear to handle some simple wildcard
> phrases correctly. In TestComplexPhraseQuery.testComplexPhrases() on
> trunk I tried these two tests:
>
> checkMatches("\"j*n sm*h\"", "1,2");
> checkMatches("\"j*n\"", "1,2,3,4");
>
> The first check succeeds. The second throws an IllegalArgumentException
> trying to rewrite the query, complaining that WildcardQuery is an
> unknown query type. If this is bad syntax I would have expected the
> first query to have failed too.
>
> Does anyone have a fix?
>
> Thanks,
> David
>
> --
> David Kaelbling
> Senior Software Engineer
> Black Duck Software, Inc.
>
> [email protected]
> T +1.781.810.2041
> F +1.781.891.5145
>
> http://www.blackducksoftware.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]