Consider index field " ProductName " having the value " dove 3.75oz " and when user searches for "dove 3.75oz" text below bool query is working fine to retreive the document:
{"bool":{"must":[{"wildcard":{"ProductName":{"value":" dove "}}},{"wildcard":{"ProductName":{"value":" 3.75oz "}}}]}}
If user searches for "dove 3.75 oz" ( Space between "3.75" and "oz" ) the bool query is failing to retrieve the same document:
{"bool":{"must":[{"wildcard":{"ProductName":{"value":" dove "}}},{"wildcard":{"ProductName":{"value":" 3.75 oz "}}}]}}
Question: How to design a query using a wildcard query that supports space or no spaces? Please share an example.