Hi all, I know IndexSearcher is thread safe. But IndexSearcher.doc is not thread safe maybe...
I try to below -------------------------------------------- First, I extract docID at index directory. And that docID add on queue(ConcurrentLinkedQueue) Second, extract field value using docID poll at this queue after extract process end. This process is work to multi-threads. For this I used the following summation code below: searcher.search( query, filter, new Collector() { public void collect( int doc ) { queue.add( docBase + doc ) } ); Thread thread1 = new Thread( () -> { while( !queue.isEmpty() ) { System.out.println( searcher.doc(queue.poll()).get("content") ); } } ); Thread thread2 = new Thread( thread1 ); thread1.start(); thread2.start(); ------------------------------------------- Result was different in every execution. My method is wrong? or IndexSearcher bug? Please help me