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=31&rev2=32

. Returns the number of milliseconds that {{{b}}} occurs before {{{a}}} (i.e. {{{a  b}}}).
Note that this offers higher precision than '''sub(a,b)''' because the arguments are not
converted to floating point numbers before subtraction. Example: '''ms(NOW,mydatefield)'''
Example: '''ms(mydatefield,20000101T00:00:00Z)''' Example: '''ms(datefield1,datefield2)'''
== dist ==
 [[Solr1.5]]
+ [[Solr1.5]] This is uncommitted code. See: https://issues.apache.org/jira/browse/SOLR1302
Return the Distance between two Vectors (points) in an ndimensional space. See http://en.wikipedia.org/wiki/Lp_space
for more information. Takes in the power, plus two or more !ValueSource instances and calculates
the distances between the two vectors. Each !ValueSource must be a number. There must be
an even number of !ValueSource instances passed in and the method assumes that the first half
represent the first vector and the second half represent the second vector.
@@ 153, +153 @@
Common cases:
 <tablewidth="467px" tableheight="88px" tablestyle="">Power Common Name 
+ <tablewidth="467px" tableheight="88px">Power Common Name 
0 Sparseness calculation 
1 Manhattan (taxicab) Distance 
2 Euclidean Distance 
@@ 169, +169 @@
1. dist(2, x,y,z,0,0,0)  Euclidean distance between (0,0,0) and (x,y,z) for each document.
+ 1. dist(1,x,y,z,e,f,g)  Euclidean distance between (x,y,z) and (e,f,g) where each letter
is a field name
+
+ == sqedist  Squared Euclidean Distance ==
+ [[Solr1.5]] This is uncommitted code. See: https://issues.apache.org/jira/browse/SOLR1302
+
+ Similar to the dist() function, the Sq. Euclidean distance calculates the 2norm (Euclidean
distance) but does not take the square root, thus saving a fairly expensive operation. It
is often the case that applications that care about Euclidean distance do not need the actual
distance, but instead can use the square of the distance. See also dist(). There must be
an even number of !ValueSource instances passed in and the method assumes that the first half
represent the first vector and the second half represent the second vector.
+
+ Signature: sqedist(pointA, pointB, ...)
+
+ Example: sqedist(x_td, y_td, 0, 0)
+
+ == hsin  Haversine Formula ==
+ [[Solr1.5]] This is uncommitted code. See: https://issues.apache.org/jira/browse/SOLR1302
+
+ The Haversine distance calculates the distance between two points on a sphere when traveling
along the sphere. In other words, it's the Great Circle distance. See http://en.wikipedia.org/wiki/Greatcircle_distance.
+
+ '''Values must be in Radians'''. Please note Haversine distance has known problems with
antipodal values. See the Wiki page.
+
+ Signature: hsin(x1,y1,x2,y2, radius)
+
+ Example: hsin(x, y, 0, 0, 1)  Calculate the haversin distance between the lat/lon 0, 0
and the values in field x,y with a radius of 1.
+
+
+
=== Date Boosting ===
Boosting more recent content is a common use case. One way is to use a {{{recip}}} function
in conjunction with {{{ms}}}.
