lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: question about custom sort method
Date Mon, 17 Jul 2006 18:59:44 GMT
On 7/17/06, Aleksey Serba <> wrote:
> Yonik, thank you for your suggestion, we use solr codebase already :)
> To tell the truth, first time i thought this is solr caching problem (
> i've modify SolrIndexSearcher to get lucene Searcher and search
> directly without any solr caching )
> I can't figure out how to use FunctionQuery - is there any wiki pages
> / examples or something?

For using it in Java code, there is the JavaDoc

You would need to create your own ValueSource that would calculate the
distance between other ValueSources.

There is also a hack in SolrQueryParser that I never documented,
because it is a bit of a hack.  It can create FunctionQuerys for
built-in functions when it sees the magic field name _val_

So _val_:"myfield"  evaluates to the numeric value of myfield.
and you can do things like
_val_:"recip(rord(mydatefield),1000,1000,1)" to boost more recent
documents by a date field.

-Yonik Solr, the open-source Lucene search server

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

View raw message