lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Multi-value fields in Lucene 4.1
Date Fri, 22 Mar 2013 13:44:01 GMT
You might be able to get close if you use PostingsHighlighter: it
tells you the offset of each matched Passage, and you can correlate
that to which field value (assuming you stored the multi-valued

You must index offsets into your postings.

But there are caveats ... if you use positional queries,
PostingsHighlighter will find highlights that didn't necessarily match
the query ... and if you use MultiTermQueries (author:Be*) you have to
pre-rewrite this otherwise PH won't highlight the terms ...

Mike McCandless

On Fri, Mar 22, 2013 at 5:57 AM, Chris Bamford
<> wrote:
> Hi,
> If I index several similar values in a multivalued field (e.g. many authors to one book),
is there any way to know which of these matched during a query?
> e.g.
>   Book "The art of Stuff", with authors "Bob Thingummy" and "Belinda Bootstrap"
> If we queried for +(author:Be*) and matched this document, is there a way of drilling
down and identifying the specific sub-field that actually triggered the match ("Belinda Bootstrap")
?  I was wondering what the lowest granularity of matching actually is - document / field
/ sub-field ...
> I am happy to index with term vectors and positions if it helps.
> Thanks,
> - Chris

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message