Add or Edit Fields

Administrators and content managers can add and edit fields (see Understanding Fields).

  1. If not already in the Add/Edit a Field [FieldName] panel, go to the panel:

    • To add a field, in the main menu, under Content, select Fields > Add Field button.

      OR

    • To edit a field, in the main menu, under Content, select Fields > field row > Edit in the Action bar.

  2. When adding a new field, in the Filter name box, enter a required descriptive name for the field.

    The field Name value is not editable once added and can only contain lowercase letters (a-z), numbers (0-9), and underscores.

    Spaces and other special characters are not allowed.

  3. When adding a new field, in the Type drop-down menu, select one of the following field types: String, Integer 32, Integer 64, Decimal or Date (see Field Types).

    • For a Boolean metadata, select a String type. The value will be either true or false.

    • The field Type is not editable once the field has been added.

  4. (Optional) In the Description box, enter information such as the creation date of the field or the value (metadata) that you want to be populated for this field.

    The date on which the item was first added to the index

  5. If you selected String at step 3, optionally select one or more of the following uses for your field:

    When editing a field, if you change the following parameters, you do not need to rebuild the sources that use this field. However, you may observe a delay before your changes become effective in affected sources. The delay period depends on the size of your index.

    See String Options.

  6. Optionally, click Advanced Settings to access more options, and then choose between one or more of the following additional options:

    • Some settings are not always editable, depending on the field origin (see Sort Fields by Origin). When editing Default fields, you cannot change the following settings: Search operator, Displayable in results, Free text search, Ranking, and Stemming.

      Moreover, some settings are not always editable, depending on the field type (see Available Options Per Field Type).

    • When editing a field, depending on the changes made in the Advanced Settings section of the Add/Edit a Field [FieldName] panel, you may need to rebuild the affected sources for the changes to be effective (see Advanced Settings) and Refresh, Rescan, or Rebuild Sources).

    See Advanced Settings.

    The following table lists the available options depending on the field type and sometimes the field use.

    Options / Field type String Integer 32 Integer 64 Decimal Date
    Search operator
    Displayable in results
    Free text search
    Ranking
    Stemming
    Use cache for sort 1
    Use cache for computed fields
    Use cache for nested queries 2
    User cache for numeric queries

    Note 1: Only available when Sort is selected.

    Note 2: Only available when Facet or Multi-value facet is selected.

  7. Click Add Field or Save.

String Options

Facet

When you select the Facet option for a field, you can later add a facet based on this field in your search page, thus allowing your search page users to further filter the results by selecting or excluding field values (see Understanding Facets). In organizations created after June 10, 2019, a facet field can also be used to identify a group of items to promote with a featured result rule (see Manage Query Pipeline Featured Results).

In your content metadata, the values of the @author field are author names such as John Smith, Mary Davis, Christopher Todd, etc. You select the Facet option so that you can put an Author facet in your search page. With such a facet, search page users can narrow down their search results to only those authored by the selected people.

Search-FacetOR

  • Numeric (Integer 32, Integer 64, and Decimal) and Date fields are facetable by default.

  • Select only when necessary to minimize unnecessary groupby processing.

  • When changing the value of the Facet option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

Multi-Value Facet

See Multi-Value Fields in Facets.

If not selected, field values appear as one occurrence of semicolon separated values (e.g., value1;value2;value3).

When changing the value of the Multi-value facet option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

Sortable

  • Numeric (Integer 32, Integer 64, and Decimal) and Date fields are sortable by default.

  • Select only when you really use this field to sort results with a sort component in a search interface since adding sorting fields can have an impact on index size and indexing performance.

  • When changing the value of the Sortable option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

Advanced Settings

Search Operator

If the Search operator check box is cleared, the index will ignore all field operations based on that field, including field queries (e.g., @date=today). This means that even components code-generated field expression produced by facets, tabs, etc. will not be able to leverage that field.

  • Selected by default since there is also no meaningful cost to select this option for all fields.

  • Changing the value of the Search operator option requires a rebuild of all the sources using this field for the change to be effective (see Refresh VS Rescan VS Rebuild).

Displayable in Results

If the Displayable in results check box is cleared, the index will never include the field in query results, which implies that you will not be able to leverage the field in the result templates of any of your search interfaces (including the Content Browser).

  • Selecting this option for all fields takes minimal disk space.

  • Changing the value of the Displayable in results option requires a rebuild of all the sources using this field for the change to be effective (see Refresh VS Rescan VS Rebuild).

Select the Free text search check box when you want the content of the field to be queried using free text. This option is not selected by default and is available only if the field type is String.

Essentially, when you enable this option, the field gets “merged” with the body of each item it has a value for in the index.

So let’s say you have an item whose body is A tasty, sweet, rather sticky liquid made from the sap of a tree that grows in North America." and whose free text search enabled @productname field value is maple sirup. Submitting maple, sirup, maple sirup (or any stemming / permutation of these two keywords) in the search box would match the item instead of having to search for @productname=="maple sirup".

If free text search is allowed on @author, items returned when querying @author=John are also returned when querying John; however, the query John also returns items containing the word John in their content, not only in the author field).

Changing the value of the Free text search option requires a rebuild of all the sources using this field for the change to be effective (see Refresh VS Rescan VS Rebuild).

Ranking

Select the Ranking check box when you want the field to be used in the standard ranking score calculation. This option is not selected by default since the option has a significant impact on query performance.

If ranking is enabled on the field Product, when a customer searches for “Product A” and some search results have Product A as a field value, those results would be ranked higher.

Changing the value of the Ranking option requires a rebuild of all the sources using this field for the change to be effective (see Refresh VS Rescan VS Rebuild).

Stemming

Select the Stemming check box when you want the user query to be stemmed in a filter specific to the field. If the value of the field shares the same root as a keyword entered by end users, the related item appears in search results. This option is not selected by default since the option has a significant impact on query performance.

The words search, searching, and searched share the same root or stem: search-. When a user queries searching in item titles (@title=searching), the Coveo Cloud platform returns items with a title containing the words searching, search, searches, and searched.

Changing the value of the Stemming option requires a rebuild of all the sources using this field for the change to be effective (see Refresh VS Rescan VS Rebuild).

Use Cache for Sort

Select the Use cache for sort check box when you want to keep the entire field in memory for fast sorting.

  • Fields that are configured for sorting and are often used should be kept in memory (see Sortable).

  • When changing the value of the Use cache for sort option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

Use Cache for Computed Fields

Select the Use cache for computed fields check box when you want to keep in memory data for computed fields. The following two use cases require the option to be selected:

  • If not selected in those scenarios, queries related to those fields might take over a second to return results, depending on your number of items.

  • When changing the value of the Use cache for computed fields option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

  • Calculated facet

    You calculate the average of the field size to populate the field author that is used as a facet. In which case, the field size must use the cache.

  • Query function expression that references a field (see Query Function)

    The following query function requires the filesizekb field to use the cache: function:"@syssize/1024" : fieldName:"@filesizekb".

Use Cache for Nested Queries

Select the Use cache for nested queries check box when you want to keep in memory the data required to perform nested queries (see Nested Queries).

  • This option also improves the performance of queries containing advanced search operators: /= (regex), *= (wildcards), %= (phonetic match), and ~= (fuzzy match) (see Advanced Field Queries).

  • When changing the value of the Use cache for nested queries option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

Use Cache for Numeric Queries

Select the Use cache for numeric queries check box when you want to keep the proper information in memory to execute operations on numerical fields, including operations on dates.

  • This option also makes the calculations related to numerical range facets faster. Thus, using the cache significantly improves the performance to automatically generate the interval values in numerical range facets and to dynamically update those values based on the content returned by the index following a user query.

  • Using the cache for numeric queries allows to use numerical fields as facets, specify the number of ranges, and let the Coveo Cloud platform index establishes the ranges.

  • Executing a query on a numerical field, especially a query that covers the entire range, impacts the query performance if the field does not use the cache.

  • If your numerical field is stored as a String, you must change its type (see Field Type).

  • When changing the value of the Use cache for numeric queries option for a field, you do not need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources.

What’s Next?