Am 15.04.2013 13:43, schrieb Uwe Schindler: Hi,
> 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? Best, Carsten -- Institut für Deutsche Sprache | http://www.ids-mannheim.de Projekt KorAP | http://korap.ids-mannheim.de Tel. +49-(0)621-43740789 | schno...@ids-mannheim.de Korpusanalyseplattform der nächsten Generation Next Generation Corpus Analysis Platform --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org