Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-950

IllegalArgumentException parsing "foo~1"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 4.0-ALPHA
    • Component/s: core/queryparser
    • Labels:
      None
    • Environment:

      Java 1.5

    • Lucene Fields:
      New

      Description

      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)

        Attachments

        1. lucene_950_08_26_2009.patch
          23 kB
          Adriano Crestani

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                eleanor Eleanor Joslin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: