Hi all,
is there a "query" where I can get only the first document of a group of
documents (e.g. all docs have the same value for field "customer")?
in SQL this is something like
id | customer | total
1 | Joe | 5
2 | Sally | 3
3 | Joe | 2
4 | Sally | 1
a query like
SELECT DISTINCT ON (customer)
id, customer, totalFROM purchasesORDER BY customer, total DESC, id
then the result would be
1 | Joe | 5
2 | Sally | 3
So only one document for each "customer" is returned.
Best regards,
Daniel
--
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.