You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Flavio Eduardo de Cordova <fl...@datasul.com.br> on 2003/07/04 16:51:20 UTC
Lucene 1.3rc1 on Java 1.3
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
Re: Lucene 1.3rc1 on Java 1.3
Posted by Bruce Ritchie <br...@jivesoftware.com>.
Flavio Eduardo de Cordova wrote:
> 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 ?
I believe the bug only affects JDK 1.3.0, I've never seen this issue on any JDK newer than and
including 1.3.1. I think there may be a bug report logged against this bug already IIRC.
Regards,
Bruce Ritchie