Count facet range in nested?

My data
user1 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
user2 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
userN= {"friends": array(.....)}
I want to list and count all persons who have 0-10 friends, 11-100 friends,
etc...
I had tried many ways to manage but it isn't successfully. Who knows how to
solve this problem, please guide me. Thanks a lot!

--
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.

Please help me, or give me a hint!

Vào 01:32:59 UTC+7 Thứ tư, ngày 03 tháng tư năm 2013, softtech Wonder đã
viết:

My data
user1 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
user2 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
userN= {"friends": array(.....)}
I want to list and count all persons who have 0-10 friends, 11-100
friends, etc...
I had tried many ways to manage but it isn't successfully. Who knows how
to solve this problem, please guide me. Thanks a lot!

--
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.

IMHO, you should handle that on client side. I mean before indexing document, just add a numberOfFriends field set to the array size.
Then, you will be able to ask for a RangeFacet on that field.

HTH

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

Le 4 avr. 2013 à 21:52, softtech Wonder wondersofttech@gmail.com a écrit :

Please help me, or give me a hint!

Vào 01:32:59 UTC+7 Thứ tư, ngày 03 tháng tư năm 2013, softtech Wonder đã viết:
My data
user1 = {"friends": array(idFriend1, idFriend2, idFriend3, idFriend4,...,idFriendN)}
user2 = {"friends": array(idFriend1, idFriend2, idFriend3, idFriend4,...,idFriendN)}
userN= {"friends": array(.....)}
I want to list and count all persons who have 0-10 friends, 11-100 friends, etc...
I had tried many ways to manage but it isn't successfully. Who knows how to solve this problem, please guide me. Thanks a lot!

--
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.

Or range facet with a script that returns the size of the friends array...
Storing it like David said is better for performance.

On Thursday, April 4, 2013, David Pilato wrote:

IMHO, you should handle that on client side. I mean before indexing
document, just add a numberOfFriends field set to the array size.
Then, you will be able to ask for a RangeFacet on that field.

HTH

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 4 avr. 2013 à 21:52, softtech Wonder <wondersofttech@gmail.com<javascript:_e({}, 'cvml', 'wondersofttech@gmail.com');>>
a écrit :

Please help me, or give me a hint!

Vào 01:32:59 UTC+7 Thứ tư, ngày 03 tháng tư năm 2013, softtech Wonder đã
viết:

My data
user1 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
user2 = {"friends": array(idFriend1, idFriend2, idFriend3,
idFriend4,...,idFriendN)}
userN= {"friends": array(.....)}
I want to list and count all persons who have 0-10 friends, 11-100
friends, etc...
I had tried many ways to manage but it isn't successfully. Who knows how
to solve this problem, please guide me. Thanks a lot!

--
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 <javascript:_e({},
'cvml', '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 <javascript:_e({},
'cvml', 'elasticsearch%2Bunsubscribe@googlegroups.com');>.
For more options, visit https://groups.google.com/groups/opt_out.

--
Thanks,
Matt Weber

--
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.