Solr - example for using percentiles

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr - example for using percentiles

Vidal, Gilad
Hi,
Can you direct me for Java example using Solr percentiles?
The following 3 examples are not seems to be working.

              search.setParam("facet", true);
              search.setParam("percentiles", true);
              search.setParam("percentiles.field", "networkTime");
              search.setParam("percentiles.requested.percentiles", "25,50,75");
              search.setParam("percentiles.lower.fence", "0");
              search.setParam("percentiles.upper.fence", "1000000");
              search.setParam("percentiles.gap", "10");
              search.setParam("percentiles.averages", true);


              search.setParam("facet", true);
              search.setParam("facets.stats.percentiles", true);
              search.setParam("facets.stats.percentiles.field", "networkTime");
              search.setParam("f.networkTime.stats.percentiles.requested", "25,50,75");
              search.setParam("f.networkTime.stats.percentiles.lower.fence", "0");
              search.setParam("f.networkTime.stats.percentiles.upper.fence", "1000000");
              search.setParam("f.networkTime.stats.percentiles.gap", "10");
              search.setParam("facets.stats.percentiles.averages", true);


              search.setParam("facet", true);
              search.setParam("facets.stats.percentiles", true);
              search.setParam("facets.stats.percentiles.field", "networkTime");
              search.setParam("facets.networkTime.stats.percentiles.requested", "25,50,75");
              search.setParam("facets.networkTime.stats.percentiles.lower.fence", "0");
              search.setParam("facets.networkTime.stats.percentiles.upper.fence", "1000000");
              search.setParam("facets.networkTime.stats.percentiles.gap", "10");
              search.setParam("facets.stats.percentiles.averages", true);

Thanks,
Gilad

Reply | Threaded
Open this post in threaded view
|

Re: Solr - example for using percentiles

Bram Van Dam
On 15/01/17 15:26, Vidal, Gilad wrote:
> Hi,
> Can you direct me for Java example using Solr percentiles?
> The following 3 examples are not seems to be working.


Not sure if this is still relevant, but I use the json.facet parameter
with SolrJ:

query.add("json.facet", "{\"ninety\":\"percentile(value,90)\"}");

 - Bram
Reply | Threaded
Open this post in threaded view
|

Re: Solr - example for using percentiles

John Blythe
Using the stats component makes short work of things.

stats.true&stats.field=foo

You can determine which stats fields are retrieved, including which
percentiles you'd like to see returned:

stats.true&stats.field{percentiles="15,50,85,90}foo

https://cwiki.apache.org/confluence/display/solr/The+Stats+Component

On Fri, Feb 17, 2017 at 5:42 AM Bram Van Dam <[hidden email]> wrote:

> On 15/01/17 15:26, Vidal, Gilad wrote:
> > Hi,
> > Can you direct me for Java example using Solr percentiles?
> > The following 3 examples are not seems to be working.
>
>
> Not sure if this is still relevant, but I use the json.facet parameter
> with SolrJ:
>
> query.add("json.facet", "{\"ninety\":\"percentile(value,90)\"}");
>
>  - Bram
>
--
--
*John Blythe*
Product Manager & Lead Developer

251.605.3071 | [hidden email]
www.curvolabs.com

58 Adams Ave
Evansville, IN 47713
Reply | Threaded
Open this post in threaded view
|

Re: Solr - example for using percentiles

Bram Van Dam
On 17/02/17 13:39, John Blythe wrote:
> Using the stats component makes short work of things.
>
> stats.true&stats.field=foo

The stats component has been rendered obsolete by the newer and shinier
json.facet stuff.

 - Bram



Reply | Threaded
Open this post in threaded view
|

Re: Solr - example for using percentiles

Chris Hostetter-3

: > Using the stats component makes short work of things.
: >
: > stats.true&stats.field=foo
:
: The stats component has been rendered obsolete by the newer and shinier
: json.facet stuff.

json.facet still doesn't support multi-shard refinement, so saying stats
(and/or) facet components are obsolute can be missleading.

For single node solr instances it probably makes no difference and the
JSON facet api is sexier for new users -- but for a lot of poeple the
accurate caclulations done by facet refinements can be pretty important.


-Hoss
http://www.lucidworks.com/