Hello Alex ,

Term aggregation is here to save your day -
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation

Thanks
          Vineeth


On Tue, Sep 2, 2014 at 12:07 PM, Alex T <atri...@gmail.com> wrote:

> Hi all!
>
> I have problem with getting unique data from elasticsearch. I have the
> following documents:
>
> [
> {
>  "message": "Message 1",
>  "author": {
>   "id": 4,
>   "name": "Author Name"
>   },
>   "sourceId": "123456789",
>   "userId": "123456"
> },
> {
>  "message": "Message 1",
>  "author": {
>   "id": 4,
>   "name": "Author Name"
>   },
>   "sourceId": "123456789",
>   "userId": "654321"
> }
> ]
>
> Different between this documents in userId. When I send query by "
> author.id", I get response with 2 documents.
>
> Can I get distinct data by sourceId field?
>
>
>  --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/1b59b2a2-484b-46cc-a95b-695e84e6d6eb%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/1b59b2a2-484b-46cc-a95b-695e84e6d6eb%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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5n_qZicXZp--7jX5vaip%3DJdadCrPQU0wzKmCYL494xmmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to