Using aggregations with a completion field

I'm relatively new to Elasticsearch. I've used aggregations with a simple search query but I don't understand how to do aggregations using a suggester on an completion field.

I don't believe you can aggregate on completion fields. Completion fields are a bit special, and maintain their own data-structure to perform the fast completion suggester. So they aren't really compatible with search/aggregations.

What are you trying to do?

I wanted to do a top hits aggregator with the results returned by the suggester. I ended up implementing an analyzer and adding it to the same field with a text type instead of doing the completion type.

I'm still confused what is the difference between the completion type and an analyzer with a text type? They seem to do the same thing but I'm able to do aggregations with the analyzer.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.