Thanks Erick, I browsed but no full answer yet.
The closest seems to be the explain method with which I could find the exact term-query or prefix-query that matched it, so I would be able to find the name of the field. I am still left with iterating through the (stored) fields and try to find the individual fields that matched.
I could also make a token-stream with all fields' contents and find the field (the fragment) which gets the best score with QueryScorer(query)? (provided query is "rewritten" so that no prefixquery appears anymore, right?)
Sounds doable but please confirm this is a correct usage of QueryScorer, I am feeling a bit unsafe here.
paul Le 22-mars-09 à 22:22, Erick Erickson a écrit :
Try searching the mail archives, the searchable archive is linked tooff the Wiki. This topic has been discussed multiple times but I forgetthe solutions...On Sun, Mar 22, 2009 at 4:30 PM, Paul Libbrecht <p...@activemath.org> wrote:in an auto-completion task, I would like to show to the user the fieldthat's been matched against the query in the found document.Typically, my documents have multiple fields for each field-name and I would like the index's findings to give me the field used. How can I dothat?It seems to me a task of the highlighter (or of the QueryScorer?) but I am actually not interested into extracting the fragment found just to know theexact field found. thanks in advance paul
smime.p7s
Description: S/MIME cryptographic signature