I am trying to implement auto suggest feature using Solr 6.6 and Spring Boot on the product_name field. I am giving following records in the core.
{"id":"xsku2023","type":"0","name":"Retro Lamp","product_id":"xprod2023","product_name":"Bajaj Lamp","product_type":"null","product_description":"Cheap and Best Lamp","listPrices":"65","plist3080002":"39.99","inventory_status":"In Stock","category_id":"catTableLamps","category_name":"TableLamps","category_href":"null","category_parent":"null","brand":"Bajaj"},
{"id":"xsku2024","type":"0","name":"Retro Lamp","product_id":"xprod2024","product_name":"Bajaj Table Lamp","product_type":"null","product_description":"Cheap and Best Table Lamp","listPrices":"65","plist3080002":"39.99","inventory_status":"In Stock","category_id":"catTableLamps","category_name":"TableLamps","category_href":"null","category_parent":"null","brand":"Bajaj"}
I have defined the /suggest endpoint as defined here and is working
I am able to achieve the basic suggest feature.
http://localhost:8983/solr/ProductATG/suggest?suggest=true&suggest.build=true&suggest.dictionary=productSuggester&wt=json&suggest.q=Baj
Getting the below response, when hitting the above URL,which is perfectly fine and I am getting the product name starting with prefix I provided in query.
{"responseHeader":{"status":0,"QTime":8},"command":"build","suggest":{"productSuggester":{"Baj":{"numFound":2,"suggestions":[{"term":"Bajaj Lamp","weight":0,"payload":""},{"term":"Bajaj Table Lamp","weight":0,"payload":""}]}}}}
Now, I want to go next level and want to achieve the result, irrespective of order. For ex.
Product name avilable in Solr index - "Bajaj Lamp", "Bajaj Table Lamp"
If I search for Lamp , both product name "Bajaj Lamp", "Bajaj Table Lamp" should come in response currently if I search Lamp no results are found is coming.