How to do filtered suggest

I am trying to do a suggest on a filtered data. Let me explain this

Let's suppose on an eCommerce portal I had text-box where I type a category and using "suggest" the elasticseach will return some options. Now I select one of this option (I call this selected category) and try to type sub-category in another text-box. In this case internally I want to elasticseach to suggest only those categories that are with the selected category

How can I achieve this?

Can someone please help me in this?

The Context Suggester may provide what you need. It allows you to provide suggestions "in the context" of some category field/tag, so that you only get suggestions that are relevant to the filtered criteria.