Villemos, Gert wrote:
I want to build a function expression for a dismax request handler 'bf'
field, to boost the documents if it is referenced by other documents.
I.e. the more often a document is referenced, the higher the boost.
Something like
<bf>linear(query(myQueryReturningACountOfHowOftenThisDocumentIsReference
d, 1), 0.01, 1)</bf>
Intended to mean;
if count is 0, then the boost is 0*0.01+1 = 1
if count is 1, then the boost is 1*0.01+1 = 1.01
If count is 100, then the boost is 100*0.01 + 1 = 2
However the query function
(http://wiki.apache.org/solr/FunctionQuery#query) seems to only be able
to return the score of the query results, not the count of results.
Probably I'm missing something, but doesn't just using
linear function meet your needs? i.e.
linear(myQueryReturningACountOfHowOftenThisDocumentIsReferenced, 0.01,1)
Koji
--
http://www.rondhuit.com/en/