Find category type base on sub type

Hi, I am quiet new in elasticsearch and it's very hard to find right solution with all the possibilities elasticsearch offers. So maybe asking question here, will be easier.

I need a way to identify some category, for example if I give "some text labrador" it know that it has to search "some text" in the "dog" category. Would be the same with "some text doberman" "some text pitbull"... Then if I search for "some text maine coon" it know that it has to search for "some text" in the category "cat", the same would apply for "some text birman"...

Right now the only solution I see, is to use synonym, but it doesn't sound right to me. First it will be a huge list, since the breed of pets can be so large. Also there will be problem with compose breed, like "maine coon". And this will also bring synonym conflict, since some breed name could be related to different kind of pet: "siberian husky" and "siberian cat", "york" could be for "cat" and "dog".

What would be the best way to handle such use-case?

1 Like

You could indeed try to handle this problem with synonyms inside Elasticsearch, but as you pointed out this doesn't feel like the best solution. This porblem sounds more like a taxonomy problem to me (see this blog for some discussions around this topic). The synonyms filter in Elasticsearch is a way to handle this, but since most search applications intercept the users search-box input before sending it to Elasticsearch I would personally advise to put some thought into pre-processing the user input with the domain knowledge you have (this could include manually constructed lists of animal names, their synonyms and relations with each other) and then generating an enriched version with that. I'm sure there are also some resources out in the wild that you can leverage with little effort to construct dictionaries with e.g. animal names and concepts around it (Wikipedia and WordNet come to mind).

2 Likes

Thanks a lot for your answer, it will help us to go in the right direction :wink:

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