FieldDictionary class is used to map fields in your data to the required fields to display in the UI.
In previous versions, this mapping was done via the
Results component. Now it's provided via the
fields property into the
Note: This is not required with the
The values can be either:
String- a simple mapping to a field in your schema.
Function- the search result object is passed to the function and then a string is expected back with the value to be used.
Array- An array in order of priority, the first match in the array will be used.
- A string template - This can be used to inject a value into a template - e.g.
By default, the fields for a website search collection are used.
|Unique identifier for the record.|
|URL for the record, required for links in results.|
|The main title for the result.|
|The subtitle. Often a brand, category, or the URL.|
|A description to display beneath the title and subtitle.|
|An image, if applicable.|
|A price, if applicable.|
|An original price, if applicable. If the value is more than price (or it's index if |
|An sale price, if applicable. If the value is less than |
|A rating, if applicable.|