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?
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?
On Sun, Sep 28, 2014 at 1:17 PM, Maarten Roosendaal <mroose...@gmail.com
<javascript:>> wrote:
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.