I'm encountering some unexpected behavior teeing up multiple Hits objects from a searcher, and I think I'm missing something obvious. Hoping a second pair of eyes might see what I'm missing.
Here's my code sequence: // Some liberties taken in the code regarding names, etc. // v1.4.3 codebase BooleanQuery combinedQuery = new BooleanQuery(); Query query = MultiFieldQueryParser.Parse(searchstring, arraySearchFields, new StandardAnalyzer()); combinedQuery.add(query); combinedQuery.add(anotherQualifyingQuery); Hits h1 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(1))); Hits h2 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(2))); Hits h3 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(3))); Hits h4 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(4))); Hits h5 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(5))); Hits h6 = oMultiSearcher.Search(new FilteredQuery(combinedQuery, new myCustomFilter(6))); int i1 = h1.length(); //yields some number x int i2 = h2.length(); //always yields x int i3 = h3.length(); //always yields x int i4 = h4.length(); //always yields x int i5 = h5.length(); //always yields x int i6 = h6.length(); //always yields x // End of code My problem: the values for i1 through i6 should be different. I've verified this by manually interrogating a small index I've created. My initial thought is the problem lies in the custom filter I've created. myCustomFilter extends Filter, and I'm following the BitSet comparitive example as found in the LIA book. I've done nothing in myCustomFilter regarding caching. I'm doubting this is a bug, but rather something I've overlooked. thanks, jeff r.