Can Lucene do a "search within search", so that the second search is constrained by the results of the first query?
Otis Gospodnetic Yes. There are two primary options:
QueryFilterwith the previous query as the filter. (you can search the mailing list archives for
QueryFilterand Doug Cutting's recommendations against using it for this purpose)
- Combine the previous query with the current query using
BooleanQuery, using the previous query as required.
BooleanQueryapproach is the recommended one.