Statistical facet for every document separately in one query

Hi to All,

Is it possible to get statistical facet for every document separately in
one query?

For example, if I get 10 results (10 documents) then I also want to have
calculated statistical facet for every document separately and returned all
together (in one query).

And if so, please provide me an example.

Thanks in advance.

Thanks you all,

Waldemar

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Waldemar,

If I understand correctly, a statistical facet will show count, total, sum
of squares, mean (average), minimum, maximum, variance, and standard
deviation.
For a single document these numbers will be very predictable, the count
will be 1, the total, average, minimum, maximum will be just the value for
the field. Variance and standard deviation will mean nothing for just 1
number.

Why would you want this info? Do you have examples of a couple of documents
so we can understand your use case?

Jaap Taal

[ Q42 BV | tel 070 44523 42 | direct 070 44523 65 | http://q42.nl |
Waldorpstraat 17F, Den Haag | Vijzelstraat 72 unit 4.23, Amsterdam | KvK
30164662 ]

On Tue, Mar 26, 2013 at 11:02 AM, waldemar@pureholidayhomes.com wrote:

Hi to All,

Is it possible to get statistical facet for every document separately in
one query?

For example, if I get 10 results (10 documents) then I also want to have
calculated statistical facet for every document separately and returned all
together (in one query).

And if so, please provide me an example.

Thanks in advance.

Thanks you all,

Waldemar

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Jaap,

I need a Min and Max from a one specific field. To be exact Its a price
field.
If there is a different method for getting that kind of information, then
please inform me of it.

Thanks,
W.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

And also I have to mention that the price field is an array that contains
multiple prices for different conditions.
So I want a min and max from all of conditions for a single document.

Thanks,
W.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I don't think the statistical facet is meant to do what you want. I doubt
it will work correctly for repeated fields.
I also don't think you can let Elasticsearch do this type of processing on
the nodes. Especially because you want to restrict whatever is in the
nested section.

What is specified in nested section can only be used to determine if the
whole document should match or not. If you get the _source back, you can
post-process the prices to reflect the same restrictions as in the nested
query.

Good luck!

Jaap Taal

[ Q42 BV | tel 070 44523 42 | direct 070 44523 65 | http://q42.nl |
Waldorpstraat 17F, Den Haag | Vijzelstraat 72 unit 4.23, Amsterdam | KvK
30164662 ]

On Tue, Mar 26, 2013 at 3:37 PM, waldemar@pureholidayhomes.com wrote:

And also I have to mention that the price field is an array that contains
multiple prices for different conditions.
So I want a min and max from all of conditions for a single document.

Thanks,
W.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I'm sorry Jaap, but you are not too helpful.
Please be more constructive, and please reply with examples.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

And why do you think you need Elasticsearch to find the min or the max in something like [ 1, 2, 3, 10 ]?
I mean that you can handle that on your side (client side) for each doc.

What Elasticsearch can offer you is to compute that values across millions of document. For single doc, I suggest to do it on your side.

Does it help?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 26 mars 2013 à 15:37, waldemar@pureholidayhomes.com a écrit :

And also I have to mention that the price field is an array that contains multiple prices for different conditions.
So I want a min and max from all of conditions for a single document.

Thanks,
W.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,

Why? Maybe because I have in that array several thousands, or even tens of
thousands prices, and I don't want to ElasticSearch return all that data,
especially when I need only min and max.
So it's obvious why I don't want to do it on the client side.
Does that make sense?

Besides, why you are asking this questions that do not relate at all to myproblem?

Best,
Waldemar

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.