Can I get term facetted statistics?

I'm trying to compute a minimum for a certain field by term.

I've added a few documents with a 'd' string and a 'p' number. For each d,
I want to have the minimum p. Is this possible? Below is what I tried, but
that totally ignores the terms...

curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":2}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":3}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"c", "p":2}'

curl -XGET 'http://localhost:9200/foo/_search?pretty=true' -d '{"fields": ["d" , "p"],"query": {"match_all": {}},"facets": {"f1": {"terms": {"field": "d" }, "statistical":"p"}'

--

Try this.
Elasticsearch Platform — Find real-time answers at scale | Elastic
http://www.elasticsearch.org/guide/reference/api/search/facets/terms-stats-facet.html

curl -XGET 'http://localhost:9200/foo/_search?pretty=true' -d '{"felds": ["d" ,
"p"],"query": {"match_all": {}},"facets": {"f1": {"terms_stats": {"key_field":
"d","value_field":"p" }}}}'

Le 17 janvier 2013 à 07:46, Iwein iwein.fuld@gmail.com a écrit :

I'm trying to compute a minimum for a certain field by term.

I've added a few documents with a 'd' string and a 'p' number. For each d, I
want to have the minimum p. Is this possible? Below is what I tried, but that
totally ignores the terms...

curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":2}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":3}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"c", "p":2}'

curl -XGET 'http://localhost:9200/foo/_search?pretty=true' -d '{"fields":
["d" , "p"],"query": {"match_all": {}},"facets": {"f1": {"terms": {"field":
"d" }, "statistical":"p"}'

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

You rock, thanks!

Iwein

On Thursday, January 17, 2013 9:42:02 AM UTC+1, David Pilato wrote:

Try this.
Elasticsearch Platform — Find real-time answers at scale | Elastic

curl -XGET 'http://localhost:9200/foo/_search?pretty=true' -d '{"felds":
["d" , "p"],"query": {"match_all": {}},"facets": {"f1": {"terms_stats":
{"key_field": "d","value_field":"p" }}}}'

Le 17 janvier 2013 à 07:46, Iwein <iwein...@gmail.com <javascript:>> a
écrit :

I'm trying to compute a minimum for a certain field by term.

I've added a few documents with a 'd' string and a 'p' number. For each
d, I want to have the minimum p. Is this possible? Below is what I tried,
but that totally ignores the terms...

curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":2}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"b", "p":3}'
curl -XPOST 'http://localhost:9200/foo/test' -d '{"d":"c", "p":2}'

curl -XGET 'http://localhost:9200/foo/_search?pretty=true' -d '{"fields": ["d" , "p"],"query": {"match_all": {}},"facets": {"f1": {"terms": {"field": "d" }, "statistical":"p"}'

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--