ModelSearch module

View

A model in the Search module, with 40 members for templates, 37 API properties and 46 members for admin templates.

Search\Models\Frontend\View Search\Models\Api\View Search\Models\Backend\View Also in Search: FacetsIndexField MasterIndexField
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 40

Take no arguments.

# getAvailableFullTextQueryTypes()
array
Returns list of available multi_match query types
# getIndexDisplay()
string
Gets the display label for the view's index (e.g. "Master", "Facets").
# getAvailableFullTextSearchFields()
array
Gets the list of all available fields for the full-text search (core fields and manually created). If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Only text fields (or their subfields) are returned.
# getAvailableHighlightFields()
array
Gets the list of fields available for highlighting.
# getAvailableFilterFields()
array
Gets the list of all available fields for the filtering. If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Moreover, if a field is a text, the ".keyword" suffix is added as that is the proper way to use them for filtering. It does not include the "relatedRecords" key in a result, but it can be used by default: send it as a filter if it is required.
# getAvailableFilterFieldTypes()
array
Gets the available filter fields that carry a castable type, mapped to that type, for the current index. The type lets a caller interpret a raw filter value correctly — for example, a boolean field so that "1" / "yes" / "on" are treated as the boolean true rather than a string that never matches.
# getAvailableSortFields()
array
Gets the list of all available fields for the sorting. They are the same as for filtering + "_score" field.
# getFullTextQueryType()
string
Returns full text query type. Currently, the type of multi_match only. Returns default type (best_fields) or the one search by the exact part of the string (phrase_prefix).
# isFullTextQueryTypeChangeable()
bool
Returns if full text query type can be changed from parameters (e.g. from URL). It is forbidden by default.
# getFullTextSearchFields()
array
Gets default full text search fields. They look like: ["entityClass" => 1, "name" => 2, "author.displayName" => 3] ‒ field name as key and its weight in value. When it returns empty array, Elasticsearch sets fields automatically according to its settings.
# isFullTextSearchFieldsChangeable()
bool
Returns if full text search fields list can be changed from parameters (e.g. from URL). It is allowed by default.
# getFilterFields()
array
Gets default filter. Key is a field name, value ‒ filter value.
# getChangeableFilterFields()
array
Gets list of filter fields that can be changed from parameter (e.g. from URL). All available filter fields by default.
# getIgnoreEmptyFilterFields()
array
Gets list of filter fields that are not applied when they are empty. If category.name= is passed in parameters and is not listed in this array, only records that have no category will be returned. If it is listed ‒ filtering by "category.name" will be skipped. All available filter fields by default.
# getRenderableFilterFields()
array
Gets a list of filter fields that are renderable, e.g. will be available in the aggregation facets/values in the template. If a field is not changeable but renderable, it is rendered as inactive (disabled). This method is primarily used for the "facets" index to determine which facets should be displayed.
# getSortFields()
array
Gets sort array. It looks like ["created desc", "name"]. The "asc" could be skipped.
# isSortFieldsChangeable()
bool
Returns if sort can be changed from parameters (e.g. from URL). It is allowed by default.
# getMinimumShouldMatch()
string
Returns "minimum_should_match" default value. Empty sting means no value is set.
# isMinimumShouldMatchChangeable()
bool
Returns if "minimum_should_match" can be changed from parameters (e.g. from URL). It is allowed by default.
# getTieBreaker()
?float
Gets tiebreaker default value. Empty sting means no value is set.
# isTieBreakerChangeable()
bool
Returns if tiebreaker can be changed from parameters (e.g. from URL). It is allowed by default.
# isFuzzy()
bool
Returns if fuzziness searching enabled. It is true by default.
# isFuzzyChangeable()
bool
Returns if fuzziness can be changed from parameters (e.g. from URL). It is true by default.
# getPageSize()
int
Gets default page size value. It is got from configuration by default.
# isPageSizeChangeable()
bool
Returns if page size can be changed from parameters (e.g. from URL). It is false by default.
# getHighlightFields()
array
Gets fields to be highlighted
# isHighlightFieldsChangeable()
bool
Returns if highlight be changed from parameters (e.g. from URL). It is true by default.
# getId()
?int
# getIndex()
?string
# isMasterIndex()
bool
Returns if the view is for the "master" index.
# isFacetsIndex()
bool
Returns if the view is for the "facets" index.
# getName()
?string
# getSlug()
?string
# getSettings()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getSite()
?Site
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 37

Read-only values on the record.

# availableFullTextQueryTypes
array
Returns list of available multi_match query types
# indexDisplay
string
Gets the display label for the view's index (e.g. "Master", "Facets").
# availableFullTextSearchFields
array
Gets the list of all available fields for the full-text search (core fields and manually created). If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Only text fields (or their subfields) are returned.
# availableHighlightFields
array
Gets the list of fields available for highlighting.
# availableFilterFields
array
Gets the list of all available fields for the filtering. If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Moreover, if a field is a text, the ".keyword" suffix is added as that is the proper way to use them for filtering. It does not include the "relatedRecords" key in a result, but it can be used by default: send it as a filter if it is required.
# availableFilterFieldTypes
array
Gets the available filter fields that carry a castable type, mapped to that type, for the current index. The type lets a caller interpret a raw filter value correctly — for example, a boolean field so that "1" / "yes" / "on" are treated as the boolean true rather than a string that never matches.
# availableSortFields
array
Gets the list of all available fields for the sorting. They are the same as for filtering + "_score" field.
# fullTextQueryType
string
Returns full text query type. Currently, the type of multi_match only. Returns default type (best_fields) or the one search by the exact part of the string (phrase_prefix).
# fullTextQueryTypeChangeable
bool
Returns if full text query type can be changed from parameters (e.g. from URL). It is forbidden by default.
# fullTextSearchFields
array
Gets default full text search fields. They look like: ["entityClass" => 1, "name" => 2, "author.displayName" => 3] ‒ field name as key and its weight in value. When it returns empty array, Elasticsearch sets fields automatically according to its settings.
# fullTextSearchFieldsChangeable
bool
Returns if full text search fields list can be changed from parameters (e.g. from URL). It is allowed by default.
# filterFields
array
Gets default filter. Key is a field name, value ‒ filter value.
# changeableFilterFields
array
Gets list of filter fields that can be changed from parameter (e.g. from URL). All available filter fields by default.
# ignoreEmptyFilterFields
array
Gets list of filter fields that are not applied when they are empty. If category.name= is passed in parameters and is not listed in this array, only records that have no category will be returned. If it is listed ‒ filtering by "category.name" will be skipped. All available filter fields by default.
# renderableFilterFields
array
Gets a list of filter fields that are renderable, e.g. will be available in the aggregation facets/values in the template. If a field is not changeable but renderable, it is rendered as inactive (disabled). This method is primarily used for the "facets" index to determine which facets should be displayed.
# sortFields
array
Gets sort array. It looks like ["created desc", "name"]. The "asc" could be skipped.
# sortFieldsChangeable
bool
Returns if sort can be changed from parameters (e.g. from URL). It is allowed by default.
# minimumShouldMatch
string
Returns "minimum_should_match" default value. Empty sting means no value is set.
# minimumShouldMatchChangeable
bool
Returns if "minimum_should_match" can be changed from parameters (e.g. from URL). It is allowed by default.
# tieBreaker
?float
Gets tiebreaker default value. Empty sting means no value is set.
# tieBreakerChangeable
bool
Returns if tiebreaker can be changed from parameters (e.g. from URL). It is allowed by default.
# fuzzy
bool
Returns if fuzziness searching enabled. It is true by default.
# fuzzyChangeable
bool
Returns if fuzziness can be changed from parameters (e.g. from URL). It is true by default.
# pageSize
int
Gets default page size value. It is got from configuration by default.
# pageSizeChangeable
bool
Returns if page size can be changed from parameters (e.g. from URL). It is false by default.
# highlightFields
array
Gets fields to be highlighted
# highlightFieldsChangeable
bool
Returns if highlight be changed from parameters (e.g. from URL). It is true by default.
# id
?int
# index
?string
# masterIndex
bool
Returns if the view is for the "master" index.
# facetsIndex
bool
Returns if the view is for the "facets" index.
# name
?string
# slug
?string
# settings
?array
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# site
?Site

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 46

Take no arguments.

# getAvailableFullTextQueryTypes()
array
Returns list of available multi_match query types
# getIndexDisplay()
string
Gets the display label for the view's index (e.g. "Master", "Facets").
# getAvailableFullTextSearchFields()
array
Gets the list of all available fields for the full-text search (core fields and manually created). If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Only text fields (or their subfields) are returned.
# getAvailableHighlightFields()
array
Gets the list of fields available for highlighting.
# getAvailableFilterFields()
array
Gets the list of all available fields for the filtering. If a field is an object, it returns its full path separated by dots, e.g. tags['name'] and tags['slug'] are returned as tags.name and tags.slug. Moreover, if a field is a text, the ".keyword" suffix is added as that is the proper way to use them for filtering. It does not include the "relatedRecords" key in a result, but it can be used by default: send it as a filter if it is required.
# getAvailableFilterFieldTypes()
array
Gets the available filter fields that carry a castable type, mapped to that type, for the current index. The type lets a caller interpret a raw filter value correctly — for example, a boolean field so that "1" / "yes" / "on" are treated as the boolean true rather than a string that never matches.
# getAvailableSortFields()
array
Gets the list of all available fields for the sorting. They are the same as for filtering + "_score" field.
# getFullTextQueryType()
string
Returns full text query type. Currently, the type of multi_match only. Returns default type (best_fields) or the one search by the exact part of the string (phrase_prefix).
# isFullTextQueryTypeChangeable()
bool
Returns if full text query type can be changed from parameters (e.g. from URL). It is forbidden by default.
# getFullTextSearchFields()
array
Gets default full text search fields. They look like: ["entityClass" => 1, "name" => 2, "author.displayName" => 3] ‒ field name as key and its weight in value. When it returns empty array, Elasticsearch sets fields automatically according to its settings.
# isFullTextSearchFieldsChangeable()
bool
Returns if full text search fields list can be changed from parameters (e.g. from URL). It is allowed by default.
# getFilterFields()
array
Gets default filter. Key is a field name, value ‒ filter value.
# getChangeableFilterFields()
array
Gets list of filter fields that can be changed from parameter (e.g. from URL). All available filter fields by default.
# getIgnoreEmptyFilterFields()
array
Gets list of filter fields that are not applied when they are empty. If category.name= is passed in parameters and is not listed in this array, only records that have no category will be returned. If it is listed ‒ filtering by "category.name" will be skipped. All available filter fields by default.
# getRenderableFilterFields()
array
Gets a list of filter fields that are renderable, e.g. will be available in the aggregation facets/values in the template. If a field is not changeable but renderable, it is rendered as inactive (disabled). This method is primarily used for the "facets" index to determine which facets should be displayed.
# getSortFields()
array
Gets sort array. It looks like ["created desc", "name"]. The "asc" could be skipped.
# isSortFieldsChangeable()
bool
Returns if sort can be changed from parameters (e.g. from URL). It is allowed by default.
# getMinimumShouldMatch()
string
Returns "minimum_should_match" default value. Empty sting means no value is set.
# isMinimumShouldMatchChangeable()
bool
Returns if "minimum_should_match" can be changed from parameters (e.g. from URL). It is allowed by default.
# getTieBreaker()
?float
Gets tiebreaker default value. Empty sting means no value is set.
# isTieBreakerChangeable()
bool
Returns if tiebreaker can be changed from parameters (e.g. from URL). It is allowed by default.
# isFuzzy()
bool
Returns if fuzziness searching enabled. It is true by default.
# isFuzzyChangeable()
bool
Returns if fuzziness can be changed from parameters (e.g. from URL). It is true by default.
# getPageSize()
int
Gets default page size value. It is got from configuration by default.
# isPageSizeChangeable()
bool
Returns if page size can be changed from parameters (e.g. from URL). It is false by default.
# getHighlightFields()
array
Gets fields to be highlighted
# isHighlightFieldsChangeable()
bool
Returns if highlight be changed from parameters (e.g. from URL). It is true by default.
# getId()
?int
# getIndex()
?string
# isMasterIndex()
bool
Returns if the view is for the "master" index.
# isFacetsIndex()
bool
Returns if the view is for the "facets" index.
# getName()
?string
# getSlug()
?string
# getSettings()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getSite()
?Site
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# getFullTextQueryTypeLabels() Admin only
array
Returns labels for the full text query type. Returns labels for multi_match.
# getAvailableEntities() Admin only
array
Returns list of available entities that are supported by the search. Indexed by entity name.
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.
# getManageUrl() Admin only
?string
Get the url for managing records.