How to implement autosuggestions with gender typeahead using Elastic search

Hi community,

I am new to Elasticsearch and I have the requirement below. Hope you can share some insights on the same.

I am trying include gender in the autosuggestions returned from backend.

Present setup : As I type in the search bar, let us say "Sh", it gives autosuggestions like shoes, shirts etc.

New requirement :

As I type in the search bar, let us say "Sh", it should return personalized autosuggestions like below based on gender in user's profile.

Example : If user is a female, return below

"shoes for women"

"shirts for women"

If user is male, return below

"shoes for men"

"shirts for men"

Can someone help me how to implement this in Elasticsearch.

Hi @dev555 !!

I don't know how your data is modeled but I believe that the product/item must have some target like "man"/"woman"/"unisex". If there is any of these classifications in the documents you could add a filter to your query and from there you would have the products for that genre. I also imagine that you know the user's gender because she does the search in a logged in environment.

1 Like

Thank you @RabBit_BR for your response.

I would like to understand how to include the gender type as suffix in the suggestions returned from Elasticsearch. Is there any special feature for adding filter type as text in the response or do we have to do it otherwise.

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