lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markharw00d <>
Subject Re: More Precise Highlighting
Date Tue, 13 Feb 2007 23:24:22 GMT
Not sure I fully understand the problem. The query is effectively 
"allContent:someTitleText" and you want to highlight the string 
"someTitleText" in the title field?
If you pass null as a fieldname to the QueryTermExtractor it will use 
all term values, regardless of field, as string to highlight.
If you pass a fieldname it will only select highlight term values for 
that field.
If you want, you can use QueryTermExtractor to extract just the 
"allContent" field values and pass a TokenStream for the "title" field 
to the highlighter and it would highlight the appropriate values in the 

Do any of these options work?

Renaud Waldura wrote:
> The old highlighter code used to highlight found terms in any field (too
> broad). The new highlighter lets one specify a field when highlighting, but
> it highlights that field only (too narrow). 
> In my case we have an "all" field that is the concatenation of all data
> about the document. When I highlight e.g. the "title" field, nothing
> happens, because the Highlighter doesn't know the title is included in this
> "all" field.
> How can I tell the highlighter that my query fields can map to some document
> fields? It looks like I'd change the QueryTermExtractor, but it's
> conveniently all-static and final.
> --Renaud

All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC

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

View raw message