# Common Suggestion with multiple fields grouped together

**URL:** <https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 25, 2022, 11:40am UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693 "2022-03-25T11:40:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabilsharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kabilsharma/32/100503_2.png) [@kabilsharma](https://discuss.elastic.co/u/kabilsharma)\
**Post date:** [March 25, 2022, 11:40am UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693/1 "2022-03-25T11:40:55Z")

</div>

Can we have a suggestion object instead of

{"suggestion":"dominos"}

to be as

{"suggestion":"dominos", "category" : "100-1000-0000", "qty" : 10}

so the results are grouped by category and pass an amount of matches in this group

and we could represent suggestions in the UI as in the following example:  
let's say search string is 'domi`

## \*\*\*Domino's Pizza 10 restaurants

## \*\*\*Dominoes shop 2 game shops

\*\*\*Dominican Republic Embassy  
1 organization

trying to improve search suggestions group wise.

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [March 30, 2022, 1:06pm UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693/2 "2022-03-30T13:06:58Z")

</div>

Hi @kabilsharma :

[Query Suggestion API](https://www.elastic.co/guide/en/app-search/current/query-suggestion.html) does not provide additional information, as it is meant to receive suggestions for a query, not result suggestions.

You can use a [search query](https://www.elastic.co/guide/en/app-search/current/search.html) in case you want to retrieve additional fields for results instead of a query suggestion, which I think matches your use case here.

I think [this response](https://discuss.elastic.co/t/getting-search-suggestion-from-secondary-field/299846/4) could be helpful for the same use case if you're using Search UI.

---

<div class="post-metadata">

**Author:** ![kabilsharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kabilsharma/32/100503_2.png) [@kabilsharma](https://discuss.elastic.co/u/kabilsharma)\
**Post date:** [March 30, 2022, 1:25pm UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693/3 "2022-03-30T13:25:25Z")

</div>

Thanks Carlos for the response. We are exactly doing the same thing you mentioned.

Facing speed issue the TTFB goes upto 1.2 seconds sometimes while calculating responses. Which is twice the time taken by suggestion query and three times more then Elasticsearch Native.

I see many people experiencing similar problem on community forum.

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [March 31, 2022, 10:08am UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693/4 "2022-03-31T10:08:14Z")

</div>

It's expected that retrieving search results instead of query suggestions take more time, as it is a different kind of request entirely.

When you say "three times more then Elasticsearch Native", what is the comparison you're doing? What query is being done using Elasticsearch native?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 28, 2022, 10:09am UTC](https://discuss.elastic.co/t/common-suggestion-with-multiple-fields-grouped-together/300693/5 "2022-04-28T10:09:04Z")

</div>

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