Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "FunctionQuery" page has been changed by GrantIngersoll. http://wiki.apache.org/solr/FunctionQuery?action=diff&rev1=52&rev2=53 -------------------------------------------------- - FunctionQuery allows one to use the actual value of a numeric field and functions of those fields in a relevancy score. + FunctionQuery allows one to use the actual value of a field and functions of those fields in a relevancy score. <<TableOfContents>> + + = What is a Function? = + + A function can be: + 1. A Constant (numeric or string literal) + 1. A Field - see notes later on multivalued/vector fields + 1. Another Function = Using FunctionQuery = There are a few ways to use FunctionQuery from Solr's HTTP interface: @@ -322, +329 @@ http://localhost:8983/solr/select/?q=boxname:findbox+_val_:"div(weight,product(product(x,y),z))"&fl=boxname,x,y,z,weight,score }}} - = Single Valued vs. Multi Valued Functions = + = Vector Functions = - <!> WARNING: Expert <!> + Until [[Solr1.5]], all functions were single valued. Since [[Solr1.5]], it is now possible for functions to use multiple values as part of a function calculation. There is not yet support for fields that have more than one token, but it is possible to aggregate multiple single value fields into a vector. - Until [[Solr1.5]], all functions were single valued. Since [[Solr1.5]], it is now possible to write multivalued functions by overriding the appropriate !DocValues methods (the ones that take in an array of the appropriate type, i.e. doubleVal(int doc, double[] vals). This is often useful when working with [[http://wiki.apache.org/solr/SchemaXml#Poly_Field_Types|Poly Fields]]. Note, however, that these multivalued functions must be aggregated up into a single value function, as the !FunctionQuery itself does not support them. + == vector == + + Takes in one or more single sources (i.e. all the stuff above) and creates a vector source. + + Signature: vector(x,y,z) + + === Distances === + + dist(), hsine() and sqedist() can work with !MultiValueSources + See the !MultiValueSource class. See https://issues.apache.org/jira/browse/SOLR-1131 - == Multi Valued Function Support == - - === toMultiVS === - <!> Name is subject to change <!> - Takes in one or more single valued ValueSource instances and creates a multivalue source. - - Signature: toMultiVS(x,y,z) - - === Distances === - - dist(), hsine() and sqedist() can work with !MultiValueSources -
