11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Additional "Expert" local params are supported in some cases for affecting the behavior of some statistics:<br />

percentiles<br />

tdigestCompression - a positive numeric value defaulting to 100.0 controlling the compression<br />

factor of the T-Digest. Larger values means more accuracy, but also uses more memory.<br />

cardinality<br />

hllPreHashed - a boolean option indicating that the statistics are being computed over a "long"<br />

field that has already been hashed at index time – allowing the HLL computation to skip this step.<br />

hllLog2m - an integer value specifying an explicit "log2m" value to use, overriding the heuristic<br />

value determined by the cardinality local param and the field type – see the java-hll documentation<br />

for more details<br />

hllRegwidth - an integer value specifying an explicit "regwidth" value to use, overriding the<br />

heuristic value determined by the cardinality local param and the field type – see the java-hll docum<br />

entation for more details<br />

calcDistinct - for backwards compatibility, calcDistinct=true may be specified as an alias for<br />

both countDistinct=true distinctValues=true<br />

Examples<br />

Here we compute some statistics for the price field. The min, max, mean, 90th, and 99th percentile price values<br />

are computed against all products that are in stock ( q=*:* and fq=inStock:true), and independently all of<br />

the default statistics are computed against all products regardless of whether they are in stock or not (by<br />

excluding that filter).<br />

http://localhost:8983/solr/techproducts/select?q=*:*&fq={!tag=stock_check}inStock:<br />

true&stats=true&stats.field={!ex=stock_check+key=instock_prices+min=true+max=true+<br />

mean=true+percentiles='90,99'}price&stats.field={!key=all_prices}price&rows=0&inde<br />

nt=true<br />

<br />

<br />

<br />

0.0<br />

2199.0<br />

328.20437693595886<br />

<br />

564.9700012207031<br />

1966.6484985351556<br />

<br />

<br />

<br />

0.0<br />

2199.0<br />

12<br />

5<br />

4089.880027770996<br />

5385249.921747174<br />

340.823335647583<br />

602.3683083752779<br />

<br />

<br />

<br />

The Stats Component and Faceting<br />

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

389

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

Saved successfully!

Ooh no, something went wrong!