lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Eduardo de Cordova <flavio.cord...@datasul.com.br>
Subject Lucene 1.3rc1 on Java 1.3
Date Fri, 04 Jul 2003 14:51:20 GMT
People..

	I have a class that searchs for some documents in an existing index
(see the code below). It works fine when I run it on a 1.4 JVM but it throws
a NullPointerException (or crashes the JVM, in another computer) when I run
it on a 1.3 JVM.
	I'm using Lucene 1.3rc1 and the exception/crash occurs in the
"search" method.

	Is it a bug ? Should I be doing something else ? Have you been using
1.3rc1 on 1.3 JVMs ?


public static void searchIndex(String path, String field, String queryStr,
String retField) {
	try {
		Searcher searcher = new IndexSearcher(path);
		MyOwnAnalyser analyser = new MyOwnAnalyser(); 
		Query query = QueryParser.parse(queryStr, field, analyser);

		Hits hits = searcher.search(query); //, filter);
		for(int i=0; i<hits.length(); i++) {
			Document doc = hits.doc(i);
			float score = hits.score(i);
			System.out.println("Found document \"" +
doc.get(retField));
		}
	} catch (Exception e1) {
		e1.printStackTrace();
	}
}


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


Mime
View raw message