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.

numdocs<br />

Returns the number of documents in<br />

the index, not including those that are<br />

marked as deleted but have not yet<br />

been purged. This is a constant (the<br />

same value for all documents in the<br />

index).<br />

numdocs()<br />

or A logical disjunction. or(value1,value2): TRUE if either value1<br />

or value2 is true.<br />

ord<br />

Returns the ordinal of the indexed field<br />

value within the indexed list of terms<br />

for that field in Lucene index order<br />

(lexicographically ordered by unicode<br />

value), starting at 1. In other words, for<br />

a given field, all values are ordered<br />

lexicographically; this function then<br />

returns the offset of a particular value<br />

in that ordering. The field must have a<br />

maximum of one value per document<br />

(not multi-valued). 0 is returned for<br />

documents without a value in the field.<br />

ord(myIndexedField)<br />

Example: If there were only three values<br />

("apple","banana","pear") for a particular field X,<br />

then: ord(X) would be 1 for documents<br />

containing "apple", 2 for documnts containing<br />

"banana", etc...<br />

ord() depends on the<br />

position in an index and can<br />

change when other<br />

documents are inserted or<br />

deleted.<br />

pow<br />

product<br />

query<br />

See also rord below.<br />

Raises the specified base to the<br />

specified power. pow(x,y) raises x to<br />

the power of y.<br />

Returns the product of multiple values<br />

or functions, which are specified in a<br />

comma-separated list. mul(...) ma<br />

y also be used as an alias for this<br />

function.<br />

Returns the score for the given<br />

subquery, or the default value for<br />

documents not matching the query.<br />

Any type of subquery is supported<br />

through either parameter<br />

de-referencing $otherparam or direct<br />

specification of the query string in the<br />

Local Parameters through the v key.<br />

pow(x,y)<br />

pow(x,log(y))<br />

pow(x,0.5): the same as sqrt<br />

product(x,y,...)<br />

product(x,2)<br />

product(x,y)<br />

mul(x,y)<br />

query(subquery, default)<br />

q=product(popularity, query({!dismax<br />

v='solr rocks'}): returns the product of the<br />

popularity and the score of the DisMax query.<br />

q=product(popularity, query($qq))&qq<br />

={!dismax}solr rocks: equivalent to the<br />

previous query, using parameter de-referencing.<br />

q=product(popularity, query($qq,0.1)<br />

)&qq={!dismax}solr rocks: specifies a<br />

default score of 0.1 for documents that don't<br />

match the DisMax query.<br />

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

274

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

Saved successfully!

Ooh no, something went wrong!