A search interface is configured by a JSON document that includes the following elements:
attributes, which configure the behavior of the search interface as a whole. See the following section for information about the attributes of a search interface.
fields, an attribute array containing the members of the search interface. Each member is a dimension or property that is examined for matches with the shopper’s search term. The order of members in the fields array can affect the order of records in search results; see Understand how the fields array affects the sorting of search results.
Search interface attributes
A search interface is configured by JSON attributes. The following table summarizes these attributes. The uses of these attributes are discussed in the sections following this table.
Attribute | Supported values | Description |
---|---|---|
| (required) | Specifies that this JSON document configures a search interface. |
|
| Specifies whether parts of a search term can be individually matched with different members. For example, given the search term “red shoes”, can matches be made between “red” and one member, and between “shoes” and another member? See Examples: cross-field matching and partial matching. Cross field matches can be made between dimensions, between properties, or between dimensions and properties. The possible values of this attribute have the following meanings:
Note: If
|
|
| Specifies whether partial query matches should be supported for the search interface that contains this element. See Examples: cross-field matching and partial matching. The possible values of this attribute have the following meanings:
|
| (required) array of attributes | Each attribute in the The position of the attribute Note: Include |
| positive integer | Specifies the maximum number of words that this member can contain. Omitting this attribute or setting its value to zero disables snippeting. Note: Snippets are useful for document searches, but are not ordinarily used by eCommerce Web sites. |
| user ID | The user who last modified the search interface. (Read only.) |
| time stamp | The time when the search interface was last modified. (Read only.) |
| time stamp | The time when the search interface was created. (Read only.) |
The following sample JSON illustrates the configuration of a search interface that includes four members, product.displayName
, product.brand
, ecr:crossField
, and product.category
:
{ "ecr:type": "search-interface", "crossFieldMatch": "always", "fields": [ { "attribute": "product.displayName " }, { "attribute": "product.brand" }, { "attribute": "ecr:crossField" }, { "attribute": "product.category" } ] }