lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederik Van Hoyweghen <>
Subject Get matching fields from a BooleanQuery
Date Mon, 19 Jun 2017 09:23:16 GMT
Hey everyone,

To start, we are using Lucene 4.3.

To search, we prepare several queries and combine these into a BooleanQuery.
What we are looking for is a way to determine on which specific fields a
certain document matched.
For example, I create 2 queries: one to search in the "Name" field, and
another to search in the "Description" field.

Combining these into a BooleanQuery and running it will return the matching
but we'd like to know for each document returned whether there was a match
in the Name field or in the Description field.

It seems to me that something like the highlighter would need to know this
too but highlighting isn't a goal currently. I've also looked at
indexsearcher.explain() but the doc says that this is as expensive as
running the query against the entire index, so I'd obviously like to avoid
running the same queries mutliple times :).

Kind regards,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message