Search index schema customization file x-schema.xml
Adding new fields into the index schema requires modifying the x-schema.xml file to add the new index field. Typically, an existing index is updated to add new fields (local index). In other instances, it is recommended to extend the product index by creating an index as an extension of an existing index (extension index).
<field name="catentry_id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
Commerce+ field types
- wc_text
- Tokenized text for searching.
- wc_keywordText
- Non-tokenized text for sorting and faceting.
- wc_keywordTextLowerCase
- Non-tokenized text for not case-sensitive sorting.
- wc_textSpell
- Spell checking for text fields.
Valid attributes for fields
- name
- (Required) The name for the field.
- type
- (Required) The name of a previously defined type from the
<types>section. - indexed
- Indicates whether the field should be indexed (searchable or sortable).
- stored
- Indicates whether the field should be retrievable.
- compressed
- Indicates whether the field should be stored by using
gzipcompression. - multiValued
- Indicates whether the field can contain multiple values per document.
- omitNorms
- Indicates whether to omit the norms that are associated with this field. Setting to true disables length normalization and index-time boosting for the field, and saves some memory.
- termVectors
- Indicates whether to store the term vector for a field.
- If an extension index is used as a filter index, where the field is always included in a filter
query and the column value is irrelevant, set the stored value to
false.
Otherwise, if the extension index always works to supplement meta information to the master core, such as inventory, set the stored value to true.
- Setting the stored field as false might save index storage space.
- If a column copies to a
destcolumn, it is unnecessary to set stored as true.
Commerce+ text field naming convention
- fieldName
- Tokenized and not case-sensitive for example, mfName.
- fieldName_cs
- Tokenized and case-sensitive for example, mfName_cs.
- fieldName_ntk
- Non-tokenized and not case-sensitive for example, mfName_ntk.
- fieldName_ntk_cs
- Non-tokenized and case-sensitive for example, catenttype_id_ntk_cs.
- Commerce Search requires one search index per language. Whenever the search schema is changed and the index is regenerated, it must be performed for every language.
- To view the customization under the workspace preview, any changes that are made to the base x-schema.xml file must also be applied to the workspace x-schema.xml file.
Local index
fields section of the
x-schema.xml file in the following directory:- workspace_dir\components\foundation\subcomponents\search\solr\home\template\CatalogEntry\conf\locale\locale
<field name="catentry_field1" type="tint" indexed="true" stored="true" required="false" multiValued="false"/>
<field name="catentry_field3" type="tfloat " indexed="true" stored="true" required="false" multiValued="false"/>
<field name="catentry_field5" type="wc_text" indexed="true" stored="true" required="false" multiValued="false"/>