[ 
https://issues.apache.org/jira/browse/LUCENE-950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621404#action_12621404
 ] 

Eleanor Joslin commented on LUCENE-950:
---------------------------------------

Also note that if the number in the query string is higher than 1 the 
same operation throws a ParseException instead.

org.apache.lucene.queryParser.ParseException: Cannot parse 'foo~1.01': 
Minimum similarity for a FuzzyQuery has to be between 0.0f and 1.0f !
        at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:150)



-- 
Eleanor Joslin, Software Development   DecisionSoft Ltd.
Telephone: +44-1865-203192             http://www.decisionsoft.com


> IllegalArgumentException parsing "foo~1"
> ----------------------------------------
>
>                 Key: LUCENE-950
>                 URL: https://issues.apache.org/jira/browse/LUCENE-950
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>    Affects Versions: 2.1, 2.2
>         Environment: Java 1.5
>            Reporter: Eleanor Joslin
>            Priority: Minor
>
> If I run this:
>     QueryParser parser = new QueryParser("myField", new SimpleAnalyzer());
>     try {
>       parser.parse("foo~1");
>     }
>     catch (ParseException e) {
>       // OK
>     }
> I get this:
> Exception in thread "main" java.lang.IllegalArgumentException: 
> minimumSimilarity >= 1
>       at org.apache.lucene.search.FuzzyQuery.<init>(FuzzyQuery.java:58)
>       at 
> org.apache.lucene.queryParser.QueryParser.getFuzzyQuery(QueryParser.java:711)
>       at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1090)
>       at 
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:979)
>       at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:907)
>       at 
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:896)
>       at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:146)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to