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=22987>. 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=22987 QueryParser not working on trivial query ------- Additional Comments From [EMAIL PROTECTED] 2003-09-11 10:43 ------- An example is pasted in below. To see the different behaviours, run as: java LucBug ID:123 java LucBug 'ID:123*' By now I learned that SimpleAnalyzer drops numbers. It was obviously not a good idea to use a SimpleAnalyzer. Nevertheless I would expect consistent behaviour. Harald. import org.apache.lucene.queryParser.*; import org.apache.lucene.search.*; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.search.Hits; import org.apache.lucene.document.*; import org.apache.lucene.index.*; import java.io.IOException; public class LucBug { public static void main(String[] argv) throws IOException, ParseException { String indexDir = "idnex"; IndexWriter w = new IndexWriter(indexDir, new SimpleAnalyzer(), true); Document d = new Document(); Field f = new Field("ID", "123", true, true, false); d.add(f); w.addDocument(d); w.close(); Query q = QueryParser.parse(argv[0], "ID", new SimpleAnalyzer()); IndexSearcher search = new IndexSearcher(indexDir); Hits h = search.search(q); for(int i=0; i<h.length(); i++) { System.out.println(h.doc(i)); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]