Minimum match and phrase slop
Influence search relevancy by using minimum match and phrase slop.
Minimum match
Specifies the number of search keywords that are required to match the indexed document, when the
ANY
search type is used. A number denotes the number of query keywords to match. A
number that is formulated with a percentage denotes that a percentage of the query keywords must
match. 1
denotes that at least one query keyword must match.2<80% 6<50%
denotes that when there are fewer than 3 keywords, both of the keywords must be found in the document. When there are 3 - 6 keywords, 80% of the keywords must be found in the document. When there are more than 6 keywords, 50% of the keywords must be found in the document.For example, if a shopper searches for 3 keywords, 80% of the 3 keywords equals 2.4. Rounded down, results that match at least 2 of the 3 entered keywords are returned.
Important: You must use the correct character encoding when you enter percentage values in a file. For example:- In a JSP fragment file, such as SearchSetup.jspf, the preceding percentage
value is entered as is:
2<80% 6<50%
. - In the wc-component.xml file, such as in this case,
wc-component.xml, the preceding percentage value is entered as:
2<80% 6<50%
.
- In a JSP fragment file, such as SearchSetup.jspf, the preceding percentage
value is entered as is:
For more information about setting values within the component configuration file, see Changing properties in the component configuration file (wc-component.xml) (Search EAR).
Depending on the length of the query sent to Solr, minMatch calculates the minimum number of
terms that must match before products are returned. For example, if shopper's search query contains
6 terms, the following values might be used:
- mm=2: products whose indexed fields contain at least 2 out of the 6 terms are returned
- mm=50%: products whose indexed fields contain at least 3 out of the 6 terms are returned
- mm=10: Solr lowers mm to 6 (to match query length), and products that match all 6 terms are returned
Note: If you use minimum match, it is recommended that you enable the runtime query expansion
algorithm. This algorithm is primarily used with minimum match and search term associations;
however, you can also enable the algorithm regardless of the search features that your site uses.
Multiple-word search results are improved because the query is enclosed within parentheses and the
query length is better controlled. For more information, see Combining minimum match with search term associations (by using the query-time expansion algorithm).
Phrase slop
Specifies how far apart the indexed search terms are in the document to influence relevancy. Phrase slop defines the amount of slop on phrase queries that are built for phrase fields.
For example, if you set a phrase slop of 1
for the red
shirt search term then red shirt is more relevant than
red striped long sleeve shirt.