lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harini Raghavan <>
Subject how to control terms to be highlighted?
Date Wed, 30 Nov 2005 12:45:37 GMT

I have a requirement to highlight search keywords in the results and 
display the matching fragment of the text with the results. I am using 
the Hits highlighting mentioned in Lucene in Action.

Here is the search query(BooleanQuery) I am passing to the IndexSearcher 
and QueryScorer:
 +(CompanyId:10 CompanyId:20 CompanyId:30 CompanyId:40)
 +FilingDate:[20041201 TO 20051201]
 +(Content:"cost saving" Content:"cost savings" Content:outsource 
Content:outsources Content:downsize Content:downsizes 
Content:restructuring Content:restructure)

My requirement is to highlight only the keywords for 'Content' field, 
but the highlighter api is also highlighting words like 'news', '10', 
'40' etc.
Is there anyway to restrict the highlighter to highlight only the values 
mentioned for the field 'Content'?


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

View raw message