match Parameter - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

The match parameter is an object containing one of the following "type" attributes:

  • keywords:is used to detect specific keywords in the query, e.g., "Red jumper".
  • compare:is in charge of detecting patterns where a facet is checked against a minimal or maximal value, e.g., price < 50 €.
  • interval:detects facet range checks, e.g., 100 m2 < area < 200 m2.

A match of type keyword includes a match attribute containing the keywords to match.

The following example matches the query « a pint of foster »:

"match": {
"type": "keywords",
"match": "foster"
},

A match of type compare includes a match attribute containing the keywords to match, and a unit attribute containing the unit.

The following example matches the query « less than 50$ ».

"match": {
"type": "compare",
"match": "less than",
"unit": "$"
},

A match of type interval includes two match1 and match2 attributes containing the "boundary" keywords to match, and a unit attribute containing the unit. In order to match, an user query must include a unit suffix for the upper bound - this suffix is optional for the lower bound.

The following example matches the following queries "flat between 100 and 200 m2" and "flat between 100m2 and 200 m2".

"match": {
"type": "interval",
"match1": "between",
"match2": "and",
"unit": "m2"
},