Dear all, I'm experiencing troubles with SpanTermQuery.getSpans(AtomicReaderContext context, Bits acceptDocs, Map<Term,TermContext> termContexts) method in version 4.6. I want to use it to retrieve payloads of matched spans.
First, I search the index with IndexSearcher.search(query, limit) and I get TopDocs. In these TopDocs, there is a certain document A. I know, that the query is an instance of PayloadTermQuery, so I search for spans using query.getSpans(indexReader.leaves().get(0), null, new HashMap()); but this wont return the spans for the document A. I observed, that getSpans method won't return any spans for documents with IDs greater than say 900, even though documents with IDs greater than 900 were returned in the original search. All other documents below ID 900 are returned sucessfully from getSpans method. I also tried passing all the leaves of indexReader to getSpans with no effect. Please help. Thank you