lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Schnober <>
Subject Re: Statically store sub-collections for search (faceted search?)
Date Mon, 15 Apr 2013 15:07:50 GMT
Am 15.04.2013 13:43, schrieb Uwe Schindler:


> Passing NULL means all documents are allowed, if this would not be the case, whole Lucene
queries and filters would not work at all, so if you get 0 docs, you must have missed something
else. If this is not the case, your filter may behave wrong. Look at e.g. FilteredQuery, IndexSearcher
or any other query in Lucene that handles acceptDocs - those pass getLiveDocs() down. If they
are null, that means all documents are allowed. The javadocs on Scorer/Filter/... should be
more clear about this. Can you open an issue about Javadocs?

I'll open an issue as soon as I have understood how this should be
corrected. :)
I think I've pin-pointed my problem: I use a TermsFilter, get a DocIdSet
with TermsFilter.getDocIdSet(atomic, atomic.reader().getLiveDocs()), and
eventually retrieve a Bits object from that with DocIdSet.bits().
However, the latter always returns null. Wrapping the TermsFilter into a
CachingWrapperFilter doesn't change that. I was using a
QueryWrapperFilter before which would give me a DocIdSet object from
which I could get a proper Bits object to pass to SpanQuery.getSpans().
Is there any way I could extract a Bits object from a TermsFilter?

>> Would this be the correct way to apply a filter on a SpanQuery?
> new FilteredQuery(SpanQuery,Filter)?

Okay, I formulated the question wrongly. I need to call
SpanQuery.getSpans() because I have to process the resultings Spans
object. Therefore, I actually meant: what is the general way to generate
a Bits object from a Filter that can be used as the 'acceptedDocs' argument?


Institut für Deutsche Sprache |
Projekt KorAP                 |
Tel. +49-(0)621-43740789      |
Korpusanalyseplattform der nächsten Generation
Next Generation Corpus Analysis Platform

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message