The following examples illustrate the effects on the search results of the crossfieldMatch
and partialMatch
attributes.
cross-field matching example
Suppose that a shopper searches for matches on the term “men’s shoes” through a search interface that is configured as follows:
The
crossFieldMatch
attribute of the search interface is set to Always, as follows:
"crossFieldMatch": "always"
The members of the search interface include a dimension named
product.category
and a property namedproduct.description
, as follows:
"fields": [
{
"attribute": "product.category "
},
{
"attribute": "product.description"
},
. . .
]
The search results for a search on the term “men’s shoes” will include the following records:
Records tagged to dimension values in the dimension
product.category
that match both “men’s” and “shoes”.Records with a property named
product.description
that matches both “men’s” and “shoes”.Records tagged to one or more dimension values in the dimension
product.category
that match “men’s” and that have a property namedproduct.description
whose value matches “shoes”.Records tagged to one or more dimension values in the dimension
product.category
that match “shoes” and that have a property namedproduct.description
whose value matches “men’s”.
partial match example
Suppose that a shopper searches for matches on the term “men’s large blue suede shoes” through a search interface that is configured with the following partialMatch
values:
"partialMatch":
{"maxWordsOmitted": 1,
"minWordsIncluded": 2
}
The value of maxWordsOmitted
specifies that a property or dimension value cannot match the shopper’s search term if it omits more than one word of the search term. Thus, only a property or dimension value that includes at least four of the five words in the search term “men’s large blue suede shoes” will match it.
The value of minWordsIncluded
specifies that a property or dimension value cannot match any search term if it includes fewer than two words of the search term.
Note: Setting minWordsIncluded
to a low value can increase the possibility of getting irrelevant results. Suppose, for example, that minWordsIncluded
is set to 1.
If the shopper enters the search term “purple jeans”, the search results include all records that match “purple jeans”. If it finds no records that match “purple jeans”, it returns any records that match “purple” or “jeans” – neither of which results is relevant to the shopper’s search.
To eliminate from the search results any records that match only the single words “purple “ or “jeans”, set minWordsIncluded
to 2. The search results now include only records that match “purple jeans”; if no records match “purple jeans” there will be no records in the search results.