lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Schaer" <ralphsch...@yahoo.com>
Subject NOT Bug in 1.3
Date Sun, 02 Feb 2003 08:37:19 GMT
Hi
I've found an error in 1.3. The NOT is not working correct. Here's the 
program. With the latest nightly build the Searcher finds the document, but
it should not. With version 1.2 the program works correct.
Regards
Ralph

      IndexWriter writer = new IndexWriter("c:\\temp\\ix", new SimpleAnalyzer(), true);
      Document doc = new Document();
      doc.add(Field.Text("txt", "one"));
      doc.add(Field.Text("txt", "two"));
      doc.add(Field.UnIndexed("id", "1"));
      writer.addDocument(doc);
      writer.optimize();
      writer.close();    
      Searcher searcher = new IndexSearcher("c:\\temp\\ix");          
      Query query = QueryParser.parse("one NOT two", "txt", new SimpleAnalyzer());       
   
      Hits hits = searcher.search(query); 
      for (int i = 0; i < hits.length(); i++) {
        System.out.println(hits.doc(i).get("id"));      
      }



---------------------------------------------------------------------
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