I have integrated Solr in an eCommerce site. Now I want to use operator AND/OR in Edismax Search query between my search keywords. If I use AND operator I want to query like Ankita AND Patel and if I use OR operator then it would be like: Ankita OR Patel
Please note I have implemented minimum should match.
How can I perform query with operators into Solr? Will it affect the result with minimum should match values?
Previously I add operators between search keywords then pass following query:
results = solrCustomWorker.Query(new SolrQuery(keyword), options);
but it won't work as per operator values. It gives the same result with whatever the operator with same mm value. For example if mm= 50% then result is same for both operator.
How can I do this? Thanks.
Minimum Should Match, i.e. MM will work only with Solr search queries where no operator is passed into search query. If any of the operator (AND/OR) is passed to the Solr search query, in that case value of mm is insignificant and will not impact results. So you can either have operator defined into the search query or let it go undefined and use minimum should match.
Moreover, it is preferable to use minimum should match as you can define how many words in the search phrase should match especially for longer phrases which is not possible when using operator.