lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <markharw...@yahoo.co.uk>
Subject RE: API suggestion
Date Tue, 07 Dec 2004 11:46:40 GMT
>>thank you, while I've seen the query.rewrite API, I
>>failed to see the application.

Lucene internally uses "rewrite()" to turn a
multi-term query into a simpler "OR" query. 
Kenne* is rewritten as Kennedy OR Kennel OR Kenneth 

Of course the exact terms used for expansion depends
on the contents of your particular index. By
pre-empting the Lucene search code and calling
"rewrite" on the query yourself you can inspect this
list of expanded terms. 
The rewritten query can then be passed into the
searcher (and the highlighter). The cost of the Lucene
searcher code rewriting the already-rewritten query is
negligible because no further expensive term expansion
is required.

This is the recommended approach used for highlighting
- see the package-level docs for the highlighter.



Hope this helps
Mark




		
___________________________________________________________ 
Win a castle for NYE with your mates and Yahoo! Messenger 
http://uk.messenger.yahoo.com

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


Mime
View raw message