Greetings all. I am having an issue that is driving me mad.

I have many indexes ranging in size from 500K docs to 40mil docs. When I do
a simple query containing multiple terms on any of the indexes, I get this:

java.lang.ArrayIndexOutOfBoundsException
        at org.apache.lucene.util.ScorerDocQueue.downHeap(ScorerDocQueue.java)
        at
org.apache.lucene.util.ScorerDocQueue.checkAdjustElsePop(ScorerDocQueue.java)
        at
org.apache.lucene.util.ScorerDocQueue.topNextAndAdjustElsePop(ScorerDocQueue.java)
        at
org.apache.lucene.search.DisjunctionSumScorer.advanceAfterCurrent(DisjunctionSumScorer.java)
        at
org.apache.lucene.search.DisjunctionSumScorer.next(DisjunctionSumScorer.java)
        at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:136)
        at org.apache.lucene.search.Searcher.search(Searcher.java:126)
        at org.apache.lucene.search.Searcher.search(Searcher.java:105)
        at LuceneIndexer.manualQuery(LuceneIndexer.java)


This is the code that does the search:

    public static String manualQuery(String index, String qstring) {
        try {
            final IndexReader ir = IndexReader.open(index);
            int len = ir.maxDoc();
            ir.close();
            final BitSet bits = new BitSet(len);
            long start = System.currentTimeMillis();
            QueryParser parser = 
                new QueryParser("note", new StandardAnalyzer(new
File("/lucenedata/stopwords.txt")));
            Query query;
            query = parser.parse(qstring);
            final IndexSearcher searcher = new IndexSearcher(index);
            searcher.search(query, new HitCollector() {
                        public void collect(int i, float v) {
                            bits.set(i);
                        }
                    });
            searcher.close();
            long stop = System.currentTimeMillis();
            return "Time: " + (stop - start) + " Count: " +
bits.cardinality();
        } catch (Exception e) {
            StringWriter sw = new StringWriter();
            PrintWriter out = new PrintWriter(sw);
            e.printStackTrace(out);
            return "error: " + e.toString() + " \n " + sw.toString();
        }
    }

Now for the real problem. I can run this with this string "phil OR john OR
bob or samuel" and it works fine. If I add a 4th term: "phil OR john OR bob
or samuel or sally" I get the error above. I can change the terms and run on
another index and it may work with 4 terms but not with 5.

I have seen the various bug reports on similar issue, but I did a checkindex
on one of my indexes and it returned 'true'. I also just upgraded to 2.4 and
it still happens.

I am desperate and on a deadline. There will be some serious karma coming to
anyone with ideas.

Thanks.


-- 
View this message in context: 
http://www.nabble.com/help%3A-java.lang.ArrayIndexOutOfBoundsException-ScorerDocQueue.downHeap-tp21037262p21037262.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to