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 fields).
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 http://blog.mikemccandless.com On Fri, Mar 22, 2013 at 5:57 AM, Chris Bamford <chris.bamf...@talktalk.net> 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: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org