A search interface is configured by a JSON document that includes the following elements:

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

ecr:type

(required) search-interface

Specifies that this JSON document configures a search interface.

crossFieldMatch

always, never, or onFailure (See below.)

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:

always

Causes the search always to look for matches between members of the search interface and the parts of a search term. always is the recommended setting for most purposes. See below for a description of the effect of setting crossFieldMatch to always.

Note: If crossFieldMatch is not specified, always is used as a default.

never

Requires that the entire search term (that is, all words that the shopper enters to search for) be found within the same member in order to make a match.

You can set crossFieldMatch to never only when the ecr:crossField attribute is not a member of the fields array.

onFailure

Causes the search to look for matches between members of the search interface and parts of a search term only if it cannot match the entire search term to any single member of the search interface.

You can set crossFieldMatch to onFailure only when the ecr:crossField attribute is not a member of the fields array.

partialMatch

maxWordsOmitted or
minWordsIncluded (See below.)

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:

maxWordsOmitted

A positive integer or zero. If the original keyword search term includes N words, then all results will match at least NmaxWordsOmitted words. The default is 2.

minWordsIncluded

A positive integer. All results will match at least this many words from the search query. The default is 2.

fields

(required) array of attributes

Each attribute in the fields array specifies a member of the search interface. An attribute can represent a property or a dimension.

The position of the attribute ecr:crossFields in the fields array specifies the position in the search results of any records that are added to the search results because of cross field matches.

Note: Include ecr:crossfield only if the value of crossFieldMatch is Always. Note also that ecr:crossfield is used only if the Fields module is included in your relevance ranking strategy. For information about relevance ranking strategies, see Configure the sorting of search results.

snippetSize

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.

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"
   }
  ]
}

Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices