Martin
Martin

Reputation: 1

Java - Lucene - How to filter a search using an array of docids

I would like to know how to restrict the search of a query within a set of docids. So far, I am able to output a list of the docids from a search to an array (or text file). I would like to search for other terms but limiting the results within this list of documents.

Please be descriptive in your answer considering I am a java newbie. I dont understand most of the javadocs covering the filter/filtereddocidset/docidset in the lucene website.

Thank you very much

Upvotes: 0

Views: 228

Answers (1)

mindas
mindas

Reputation: 26733

You could implement a custom Collector (see Javadoc example on how this is done). In the collect method, you would only set the BitSet flag for the matching docIds which, I assume, you obtain somehow externally.

Upvotes: 1

Related Questions