Solr FunctionQuery Functions: gte, lte, eq

The Solr FunctionQuery function has a DIV (x, y) function. I have such a need, if y = 0, then y should be equal to x.

In other words, I need to present the following logic using FunctionQuery:

if y == 0, return 1 /* i.e. DIV(x,x) */
else, return DIV(x,y)

Be that as it may, from the Solr document I cannot find any comparison function, for example. EQ (x, value), etc. For me.

Can anyone give me a hint for building my desired logic using FunctionQuery?

Thank!

+5
source share
3 answers

To clear this question and register what is my final decision, thanks to Srinant Wengopalan:

. exposure_count = 0 false. , {! Boost b = if (exposure_count, div (1, exposure_count), 1)} "

, Lucid , . FunctionQuery , ==, , , , . , IF() () (( ).

Solr wiki .

+3

:

(termfreq (_, "" ), 2,1)

2, "" "fieldname" (termfreq > 0)

+2

== equals , : -

. if(y == 0; 1; DIV(x,y))

@

if(color=="red"; 100; if(color=="green"; 50; 25)):
This function checks the document field "color", and if it "red" returns 100, if it "green" returns 50, the other returns 25.

Edit: -

Solr if wiki mentions (comma) as delimiter

eg. if(exists(myField),100,0)

0
source

All Articles