lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19149] New: - QueryParser fails on querys using "AND" and stopwords
Date Fri, 18 Apr 2003 12:35:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19149>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19149

QueryParser fails on querys using "AND" and stopwords

           Summary: QueryParser fails on querys using "AND" and stopwords
           Product: Lucene
           Version: 1.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: QueryParser
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: contact@wennysoft.de


The queries (1) "+this +tree" and (2) "this AND tree" should both be parsed to
the same query-object.

the following code-snippet shows a bug in QueryParser.
Query (1) is correctly parsed. Parsing Query (2) results in an
IndexOutOfBoundsException.

It seems that the Parser first removes the stop-word "this", resulting in the
query "AND tree" and then fails to parse this query. Replacing "this" by a
non-stopWord produces no errors.

try {
  StandardAnalyzer tAnalyzer = new StandardAnalyzer();

  Query tQuery1 = QueryParser.parse("+this +tree", "content", tAnalyzer);
  System.out.println(tQuery1.toString("content"));
            
  Query tQuery2 = QueryParser.parse("this AND tree", "content", tAnalyzer);
  //never reached!
  System.out.println(tQuery2.toString("content"));
} catch ( Exception e ) {
  e.printStackTrace();
}

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message