Performing two searches in Solr for every search on the website would not be optimal. However, we need to identify the fields before performing the search. Another easier way to do this is to incorporate the dictionary in the product catalog index itself.
For this, we will have to create fields in our index matching the dictionary key fields. Then during indexing, we need to populate the key fields with words that match the product. Let us take an example to understand this. In our case, let us say that we are dealing with three fields in our dictionary, clothes_type
, clothes_color
, and brand
. We would create three new fields in our product index, key_clothes_type
, key_clothes_color
, and key_brand
. These fields would contain product-specific information that matches with our dictionary.
For the product, wrangler jeans
, the information in these fields would be:
key_clothes_type : jeans key_clothes_color : blue key_brand : wrangler
For the next product, skinny fit black jeans
, the...