lucene-java-user mailing list archives

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

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:
 +DocumentType:news
 +(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'?

Thanks,
Harini





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message