Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

ArrayIndexOutofBoundsException #29

Closed
mircouleur opened this issue Jul 21, 2010 · 0 comments
Closed

ArrayIndexOutofBoundsException #29

mircouleur opened this issue Jul 21, 2010 · 0 comments

Comments

@mircouleur
Copy link

Hello Jake,

This use case doesn't work if you add it in the LucantdraTest Class. Could you have a look please?

public void testReproduceScoringError() throws Exception {

    IndexReader indexReader = new IndexReader(indexName, client);



    // Explicit call to clearCache before of the ThreadLocal shared

    // instance of cache... 

    indexReader.clearCache();



    for (int i = 0; i < 10; i++) {

        Document doc1 = new Document();

        doc1.add(new Field("newkey", "newkey"+i, Field.Store.YES, Field.Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS));

        doc1.add(new Field("category", "category1", Field.Store.YES, Field.Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS));

        indexWriter.addDocument(doc1, analyzer);

    }



    IndexSearcher searcher = new IndexSearcher(indexReader);



    QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, "newkey", analyzer);

    Query q = qp.parse("newkey:newkey1 OR category:category1");

    TopDocs docs  = searcher.search(q, 100);

    assertEquals(10, docs.totalHits);



}
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant