Thank you David, I try to explain better.

http://localhost/ctweets/tweet/_search

Query: Define average age of users that have name ''Fisnik".

I tried query that i write above but it does not calculated average age of 
users with name "Fisnik". 
Shows me all  users with name :Fisnik", but in "Aggregations" in avg shows 
value=0;

I



On Monday, December 8, 2014 4:22:13 AM UTC+1, David Pilato wrote:
>
> May be a full SENSE example as a GIST would help understand what you are 
> doing?
> Age is a String?
>
> David
>
> Le 8 déc. 2014 à 02:00, Mengjiqi Fisnik <[email protected] 
> <javascript:>> a écrit :
>
> Define average age of the users with name "Jone"
>
> {
>     
>             "query" : {
>         "match" : { "name" : "Jone" }
>           },
>
>
>             "aggs" : {
>                 "avg_age" : { "avg" : { "field" : "age" } }
>             }    
>     
> }
>
> This request hits all item with names Jone, but do not calculate average. 
>  Aggregation avg display 0.
>
>  -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/46076a0f-daf1-4373-8f3f-94d67dc82d53%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/elasticsearch/46076a0f-daf1-4373-8f3f-94d67dc82d53%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4cec7460-337f-4eb7-9d08-4ac19f96ac19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to