Add or edit a field
Add or edit a field
Members with the required privileges can add and edit fields (see About fields).
-
If not already in the Add/Edit a Field panel, access the panel:
-
To add a field, in the main menu, under Content, select Fields > Add Field.
OR
-
To edit a field, in the main menu, under Content, select Fields > field row > Edit in the Action bar.
-
-
When adding a new field, in the Field name box, enter a required descriptive name for the field. Note that it’s impossible to have two fields of the same name.
-
When adding a new field, in the Type dropdown menu, select a field type.
Notes-
For a Boolean metadata, select a String type. The value will be either
true
orfalse
. -
The Type isn’t editable once the field has been added.
-
-
(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.
NoteThe field Description isn’t editable once the field has been added.
-
If you selected String in step 3, optionally select one or more of the following uses for your field:
NoteSee String options.
-
Optionally, click Advanced Settings, and then choose one or more options. See Advanced settings for option details.
Notes-
Some settings aren’t always editable, depending on the field origin. When editing Default fields, you can’t change the following settings: Search operator, Displayable in results, Free text search, Ranking, and Stemming.
Moreover, some settings aren’t 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.
-
-
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 interface, therefore allowing its users to further filter their results by selecting or excluding field values (see Using facets). A facet field can also be used to identify a group of items to promote with a featured result rule (see Manage featured result rules).
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 interface users can narrow down their search results to only those authored by one of the selected people.
By default, the Facet Generator option is enabled for facet and multi-facet fields. This lets the Facet Generator provide facets based on the input query and the content of your index.
Optionally, enter a name to display when a facet based on this field appears in your search interface.
For example, if your field name is @sysauthor
, you can enter Author
as the display name.
If you don’t enter a name, the facet will display the field name.
Notes
|
Multi-value facet
You can select the Multi-value facet option as an alternative to the Facet option to indicate that a field may have several values. A facet based on a multi-value field looks and works similarly to a facet based on a regular field (see Using facets). Search results with more than one value for a facet field are kept on the search result page from the moment you select one of these values in the facet.
You index items that may have been edited by several individuals.
Their names are indexed in the @author
field, so you check the Multi-value facet box for this field.
In your search interface, when an end user selects names in the Author
facet to refine their search results, the items with multiple authors are visible as long as one of their names is selected in the facet.
By default, the Facet Generator option is enabled for facet and multi-facet fields. This lets the Facet Generator provide facets based on the input query and the content of your index.
Optionally, enter a name to display when a facet based on this field appears in your search interface.
For example, if your field name is @sysauthor
, you can enter Author
as the display name.
If you don’t enter a name, the facet will display the field name.
If you don’t check the Multi-value facet box for a field with many values, Coveo interprets these values as a single one.
It’s therefore impossible to use them as separate values in a facet, and they instead appear as a single option (for example, value1;value2;value3
).
Selecting this facet option filters out any item that doesn’t have exactly this set of values.
Note
When changing the value of the Multi-value facet option for a field, you don’t need to rebuild the sources that use this field. However, you may observe a delay before your change becomes effective in affected sources. |
Sortable
Notes
|
Advanced settings
The following table lists the available options depending on the field type and sometimes the field use.
Option or field type | String | Integer 32 | Integer 64 | Decimal | Date | Vector |
---|---|---|---|---|---|---|
Search operator | ||||||
Displayable in results | ||||||
Free text search | ||||||
Ranking | ||||||
Stemming | ||||||
Use cache for sort | ||||||
Use cache for computed fields | ||||||
Use cache for nested queries | ||||||
Use cache for numeric queries |
Search operator
If the Search operator box is cleared, the index ignores all field operations based on that field, including field queries (for example, @date=today
).
This means that even components code-generated field expression produced by facets, tabs, etc.
can’t leverage that field.
Notes
|
Displayable in results
If the Displayable in results box is cleared, the index never includes the field in query results, which implies that you can’t leverage the field in the result templates of any of your search interfaces (including the Content Browser).
Notes
|
Free text search
Check the Free text search box when you want the content of the field to be queried using free text. This option isn’t 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.
Leading practice
This implies that the item body size increases with the size of its free text searchable fields. With fields that contain a lot of text, this could have a performance impact. Therefore, you should only enable the Free text search option when necessary. |
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 syrup. Submitting maple, syrup, maple syrup (or any stemming or permutation of these two keywords) in the search box would match the item instead of having to search for @productname=="maple syrup"
.
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).
Note
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. |
Ranking
Check the Ranking box when you want the field to be used in the standard ranking score calculation. This option isn’t selected by default since the option has a significant impact on query performance.
If ranking is enabled for the product
field, when a customer searches for "Product A" and some search results have Product A
as a value of this field, these results would be ranked higher.
Note
Changing the value of the Ranking option requires a rebuild of all the sources using this field for the change to be effective. |
Stemming
Check the Stemming box to allow stemming on field queries. This option isn’t 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
), Coveo returns items with a title containing the words searching, search, searches, and searched.
Note
Changing the value of the Stemming option requires a rebuild of all the sources using this field for the change to be effective. |
Use cache for sort
Check the Use cache for sort box when you want to keep the entire field in memory for fast sorting.
Notes
|
Use cache for computed fields
Check the Use cache for computed fields box when you want to keep data in memory for computed fields. The following two use cases require the option to be selected:
Notes
|
-
Calculated facet
ExampleYou calculate the average of the
size
field value to populate the fieldauthor
, which is used as a facet field. Thesize
field must therefore use the cache. -
Query function expression that references a field
ExampleThe following query function requires the
filesizekb
field to use the cache:function:"@syssize/1024" : fieldName:"@filesizekb"
.
Use cache for nested queries
Check the Use cache for nested queries box when you want to keep in memory the data required to perform nested queries.
Notes
|
Use cache for numeric queries
Check the Use cache for numeric queries box when you want to keep the proper information in memory to execute operations on numerical fields, including operations on dates.
Notes
|
What’s next?
-
Enter the name of the metadata used as a source for each added field or enter the desired default value (see Manage source mappings).
-
If you edited field settings that require a source rebuild, access the Sources (platform-ca | platform-eu | platform-au) page to launch the rebuild operation and apply your changes.