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:

  1. Use QueryFilter with the previous query as the filter. (you can search the mailing list archives for QueryFilter and Doug Cutting's recommendations against using it for this purpose)
  2. Combine the previous query with the current query using BooleanQuery, using the previous query as required.

The BooleanQuery approach is the recommended one.