Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by YonikSeeley: http://wiki.apache.org/solr/FunctionQuery The comment on the change is: nested queries via query() ------------------------------------------------------------------------------ NOTE: This implementation currently cannot distinguish when documents have been deleted or documents that have no value, and 0.0 values will be used for these cases. This means that if values are normally all greater than 0.0, one can still end up with 0.0 as the min value to map from. In these cases, an appropriate map() function could be used as a workaround to change 0.0 to a value in the real range. example: '''scale(map(x,0,0,5),1,2)''' + === query === + <!> ["Solr1.4"] + query(subquery, default) returns the score for the given subquery, or the default value for documents not matching the query. Any type of subquery is supported through either parameter dereferencing {{{$otherparam}}} or direct specification of the query string in the LocalParams via "v". + + Example Syntax: '''q=product(popularity, query({!dismax v='solr rocks'})''' returns the product of the popularity and the score of the dismax query. + + Example Syntax: '''q=product(popularity, query($qq)&qq={!dismax}solr rocks''' is equivalent to the previous query, using param dereferencing. + + Example Syntax: '''q=product(popularity, query($qq,0.1)&qq={!dismax}solr rocks''' specifies a default score of 0.1 for documents that don't match the dismax query. + === linear === linear(x,m,c) implements m*x+c where m and c are constants and x is an arbitrary function. This is equivalent to '''sum(product(m,x),c)''', but slightly more efficient as it is implemented as a single function. Example Syntax: '''linear(x,2,4)''' returns 2*x+4
