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 Re: how to control terms to be highlighted?
Date Thu, 01 Dec 2005 05:08:41 GMT
Hi Mark,

It would be great if you can make this change and send the
QueryTermsExtractor class. I am invoking the QueryScorer(Query)
contructor. Should I use QueryScorer(Query query, IndexReader reader,
String fieldName) instead for this to work?

Thanks,
Harini

mark harwood wrote:

>>>>Is there anyway to restrict the highlighter to
>>>>        
>>>>
>>highlight only the values 
>>mentioned for the field 'Content'?
>>    
>>
>
>The problem lies in the QueryTermsExtractor class
>which is typically used to provide the Highlighter
>with the list of strings to identify in the text. It
>currently has no filter for fieldname - you could add
>this without too much effort.
>
>I could make this modification but it may change the
>behaviour of existing applications - currently the
>QueryTermsExtractor method that takes a fieldname only
>uses that fieldname to derive IDF weightings, the
>proposed change would also have the effect of
>filtering out any query terms that weren't for this
>field. 
>Would this change be a problem for anyone?
>
>Cheers,
>Mark
>
>--- Harini Raghavan <harini.raghavan@insideview.com>
>wrote:
>
>  
>
>>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
>>
>>
>>    
>>
>
>
>
>		
>___________________________________________________________ 
>Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>  
>


---------------------------------------------------------------------
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