Get Distinct value in Elastic App Search

Hi
i am using Elastic Enterprise Search for searching document , where i have requirement where i want to get distinct value of 1 field -
for example i want to get distinct brand name available in my engine .
this is my simple search request

{

    "query": "coke",

    "result_fields": {

        "brand": {

            "raw": {},

            "snippet": {

                "size": 100,

                "fallback": true

            }

        }

    }

}

but this will give all the record , i know how to get distinct value in Elasticsearch , but am not sure is same is possible in App Search .
Thanks

Hey @DILIP_SHARMA,

Can you give me an example of what results you were expecting to see? Were you expecting to see a list of distinct brand names?

Jason

Hi @JasonStoltz

Yes ,
For example if my search engine have thise record

Brand ItemCode ItemDescription
Coke I1 Coke 200 ml
Coke I2 Coke 1.2 ltr
Thumsup I3 Thumsup 500 ltr
Thumsup i4 Thumsup 1 ltr
Fenta i5 fenta 200 ml

so i want result
coke
Thumsup
Fenta

thanks

I understand. I think Facets are the solution you are looking for: https://www.elastic.co/guide/en/app-search/7.8/facets.html#facets-value-facet.

i have looked the facet , yes not thought before but yes may be its can serve the desire input . Thanks

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