Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fields): add params to FieldModel for Facet Generator #687

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions src/resources/Fields/FieldsInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,118 @@ import {Paginated} from '../BaseInterfaces.js';
import {FacetOrSortStatus, FieldOrigin, FieldTypes, SortingOrder} from '../Enums.js';

export interface FieldModel {
/**
* Whether this field is to be considered by the facet generator feature.
*/
automaticFacetsCandidate?: boolean;
/**
* A regex indicating the date format, for some date type fields.
*/
dateFormat?: string;
/**
* A description of the field.
*/
description?: string;
/**
* Whether [Group By](https://docs.coveo.com/en/203/glossary/group-by) operations and [Facet](https://docs.coveo.com/en/198/glossary/facet) requests can be performed on the field.
*/
facet?: boolean;
/**
* Whether the field contains multiple values that form a hierarchy (see also the multiValueFacetTokenizers property).
* Note: Applicable to field type STRING only.
*/
hierarchicalFacet?: boolean;
/**
* Whether this field can be referred to in [Coveo Cloud query syntax](https://docs.coveo.com/en/149/index-content/available-boolean-field-options) expressions.
*/
includeInQuery?: boolean;
/**
* Whether the field can be included in the raw property of [query](https://docs.coveo.com/en/231/glossary/query) results.
*/
includeInResults?: boolean;
/**
* Whether field values with differing accents should be considered distinct facet values.
* Note: Applicable to field type STRING only.
*/
keepAccentsDisplayValueFacet?: boolean;
/**
* Whether the field is a dictionary field, which contains mappings of keys to values instead of a single value.
*/
keyValue?: boolean;
/**
* A displayable label for the field when used by the facet generator.
*/
label?: string;
/**
* Whether the field is free text searchable.
* Note: Applicable to field type STRING only.
*/
mergeWithLexicon?: boolean;
/**
* Whether the field contains multiple values (see also the multiValueFacetTokenizers property).
* Note: Applicable to field type STRING only.
*/
multiValueFacet?: boolean;
/**
* The character to use as a value separator, if the field contains multiple values (see also the multiValueFacet property).
*/
multiValueFacetTokenizers?: string;
/**
* The name of the field, also referred to as the field identifier, or fieldId.
* Note: Must match ^([a-z][a-z0-9_]{0,254})$
*/
name?: string;
/**
* Whether to use the field in result ranking calculation only.
* Notes:
* - Has a significant impact on query performance.
* - Applicable to field type STRING
*/
ranking?: boolean;
/**
* Whether to transform date and time string values into semicolon separated number of days/weeks/months/quarters/years since January 1st, 1900.
* Note: Applicable to field type DATE only.
*/
smartDateFacet?: boolean;
/**
* Whether query results can be sorted based on the value of the field.
*/
sort?: boolean;
/**
* Whether to allow an item to match the query when the value of this field for this item stems from the same root as one of the query expression keywords.
* Notes:
* - applicable to STRING type fields only.
* - Has a significant impact on query performance.
*/
stemming?: boolean;
/**
* Whether the field is a standard Coveo field.
* Note: system option can not be set to true.
*/
system?: boolean;
/**
* The data type of the field.
* See [Field Types](https://docs.coveo.com/en/2036/index-content/about-fields#Field2).
*/
type?: FieldTypes;
/**
* Whether to keep computed field data in memory.
* Note: Cannot be enabled on STRING type fields.
*/
useCacheForComputedFacet?: boolean;
/**
* Whether to keep the data required to perform nested queries in memory.
* Note: only applicable to fields which are faceted or multi-value faceted.
*/
useCacheForNestedQuery?: boolean;
/**
* Whether to keep the data required to execute operations on numeric and date fields in memory.
* Note: Cannot be enabled on STRING type fields.
*/
useCacheForNumericQuery?: boolean;
/**
* Whether to keep the entire field in memory for fast sorting.
*/
useCacheForSort?: boolean;
}

Expand Down