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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to