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 "Armbrust, Daniel C." <Ar...@mayo.edu> on 2002/04/11 16:40:24 UTC

Proper use of Lucene?

I want to know if this is supposed to be a legal thing to do with lucene:

I indexed some files into index 1 that had fields x, y, and z.

I indexed some files into a index 2 that had fields x, y, q.

I used a multisearcher on the two indexes, and search for things like

q:term

So far, this all works.  However, if I search for 

q:ter*

lucene throws an exception.  Specifically:
Opening index:
/people/medinf1/projects/vocabulary/CNI/test/prototype/index...done
Opening index:
/people/medinf1/projects/vocabulary/CNI/test/prototype/index2...done
Enter query: q:mit*
java.lang.NullPointerException
        at org.apache.lucene.index.SegmentTermEnum.clone(Unknown Source)
        at org.apache.lucene.index.TermInfosReader.terms(Unknown Source)
        at org.apache.lucene.index.SegmentReader.terms(Unknown Source)
        at org.apache.lucene.search.PrefixQuery.getQuery(Unknown Source)
        at org.apache.lucene.search.PrefixQuery.sumOfSquaredWeights(Unknown
Source)
        at org.apache.lucene.search.BooleanQuery.sumOfSquaredWeights(Unknown
Source)
        at org.apache.lucene.search.Query.scorer(Unknown Source)
        at org.apache.lucene.search.IndexSearcher.search(Unknown Source)
        at org.apache.lucene.search.MultiSearcher.search(Unknown Source)
        at org.apache.lucene.search.Hits.getMoreDocs(Unknown Source)
        at org.apache.lucene.search.Hits.<init>(Unknown Source)
        at org.apache.lucene.search.Searcher.search(Unknown Source)
        at org.apache.lucene.search.Searcher.search(Unknown Source)
        at
edu.mayo.mir.cni.search.SearchTest.commandLineTest(SearchTest.java:82)
        at edu.mayo.mir.cni.search.SearchTest.main(SearchTest.java:175)

Should I be able to do this?
If so, I'll grab a copy of the newest release of lucene (I'm using 1.2 beta
1 now I think) and see if it still happens.  I'll try to write up a self
contained bug test too, but I'm not sure I'll be able to do that for a
couple of days.

Thanks, 

Dan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>