Hi,

I'm trying to solve the following use case with elasticsearch: we want to 
provide users with autocomplete functionality but the results of a typed 
term should be aggregated by type of entity in the index, like brand and 
creator.

For example, i have this in the index (name, type, score) 
brand a score 10
brand aa score 20
brand aaa score 11
brand aaaa score 9

creator a score 30
creator aa score 10
creator aaa score 9
creator aaaa score 11

what i want: top 2 highest scoring results per type (brand, creator) for 
search 'starts with a' should be:
brand
brand aa
brand aaa
creator
creator a
creator aaaa

how can you do this in es? Or do i have to use multiple queries (per type) 
and aggregate the result in the application?

Thanks,
Maarten

-- 
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/1e3a7a13-3f2c-47db-b2f1-b066441d9765%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to