11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sqrt<br />

strdist<br />

Returns the square root of the<br />

specified value or function.<br />

Calculate the distance between two<br />

strings. Uses the Lucene spell checker<br />

StringDistance interface and<br />

supports all of the implementations<br />

available in that package, plus allows<br />

applications to plug in their own via<br />

<strong>Solr</strong>'s resource loading capabilities. st<br />

rdist takes (string1, string2, distance<br />

measure). Possible values for distance<br />

measure are:<br />

jw: Jaro-Winkler<br />

edit: Levenstein or Edit distance<br />

ngram: The NGramDistance, if<br />

specified, can optionally pass in the<br />

ngram size too. Default is 2.<br />

FQN: Fully Qualified class Name for<br />

an implementation of the<br />

StringDistance interface. Must have a<br />

no-arg constructor.<br />

sqrt(x)sqrt(100)sqrt(sum(x,100))<br />

strdist("SOLR",id,edit)<br />

sub Returns x-y from sub(x,y). sub(myfield,myfield2)<br />

sub(100,sqrt(myfield))<br />

sum<br />

sumtotaltermfreq<br />

termfreq<br />

Returns the sum of multiple values or<br />

functions, which are specified in a<br />

comma-separated list. add(...) may<br />

be used as an alias for this function<br />

Returns the sum of totaltermfreq<br />

values for all terms in the field in the<br />

entire index (i.e., the number of<br />

indexed tokens for that field). (Aliases<br />

sumtotaltermfreq to sttf.)<br />

Returns the number of times the term<br />

appears in the field for that document.<br />

sum(x,y,...) sum(x,1)<br />

sum(x,y)<br />

sum(sqrt(x),log(y),z,0.5)<br />

add(x,y)<br />

If doc1:(fieldX:A B C) and doc2:(fieldX:A A A A):<br />

docFreq(fieldX:A) = 2 (A appears in 2 docs)<br />

freq(doc1, fieldX:A) = 4 (A appears 4<br />

times in doc 2)<br />

totalTermFreq(fieldX:A) = 5 (A appears 5<br />

times across all docs)<br />

sumTotalTermFreq(fieldX) = 7 in fieldX,<br />

there are 5 As, 1 B, 1 C<br />

termfreq(text,'memory')<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

276

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!