On 2010-03-22 18:06, zsl wrote:

I was thinking about that, but i dont know if it is the best option. Ty.

There is a certain trick to do this with the current API (let's hope the new API is more .. flexible .. ? ;) )

Implement a dummy Searcher that delegates most of its work to the real Searcher, except for docFreq(Term), where you return your arbitrary values. Then do Searcher.rewrite(Query) to expand the query, and then Query.weight(Searcher) to obtain a Weight - which uses your modified IDF.

Finally, use this Weight to run a query against your real Searcher.

You can see this approach implemented here:

https://issues.apache.org/jira/browse/SOLR-1632

though this contains some Solr-specific scaffolding, too.


--
Best regards,
Andrzej Bialecki     <><
 ___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to