Package org.opencms.search.fields
Class CmsSearchField
java.lang.Object
org.opencms.search.fields.CmsSearchField
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CmsLuceneField
,CmsSolrField
A abstract implementation for a search field.
- Since:
- 8.5.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the field that contains the (optional) category of the document (hardcoded).static final String
static final String
Name of the field that usually contains the complete content of the document (optional).static final String
Name of the field that contains the complete extracted content of the document as serialized object (hardcoded).static final String
Name of the field that contains the locale of the document.static final String
Name of the field that contains the document content date (hardcoded).static final String
Name of the field that contains the document creation date (hardcoded).static final String
Name of the field that contains the document creation date for fast lookup (hardcoded).static final String
The field name for the expiration date.static final String
Name of the field that contains the document last modification date (hardcoded).static final String
Name of the field that contains the document last modification date for fast lookup (hardcoded).static final String
The lookup suffix for date fields.static final String
The field name for the release date.static final String
The dependency type.static final String
Name of the field that usually contains the value of the "Description" property of the document (optional).static final String
The field PREFIX of the fields that contain the display order (without locale and postfix "_i").static final String
The field PREFIX of the fields that contain the display title (without locale and postfix "_s").static final String
Name of the dynamic exact field.static final String
Name of the dynamic property field (searched properties).static final String
Name of the dynamic property field (non-searched properties).static final String
The name of the dynamic field that stores the shortened value of the content field in order to save performance.static final String
Name of the field that contains the filename.static final String
Name of the field that contains Geo coordinates.static final String
Name of the field that contains the documents structure id.static final String
The field PREFIX where the start date for the single entry of a serial date entry set is stored.static final String
The field PREFIX where the date until which the single entry of a serial date entry should be treated as "current" is stored.static final String
The field PREFIX where the end date for the single entry of a serial date entry set is stored.static final String
The field PREFIX where the start date and the end date of the single entry of a serial date entry is stored as a date range.static final String
Name of the field that usually contains the value of the "Keywords" property of the document (optional).static final String
The field name for the link.static final String
Name of the field that usually combines all document "meta" information, that is the values of the "Title", "Keywords" and "Description" properties (optional).static final String
Name of the field that contains the mime type.static final String
Name of the field that contains all VFS parent folders of a document (hardcoded).static final String
Name of the field that contains the document root path in the VFS (hardcoded).static final String
static final String
static final String
The default (single-valued) date field postfix.static final String
The default (single-valued) date range field postfix.static final String
The default (multi-valued) date range field postfix.static final String
The default (multi-valued) dates field postfix.static final String
The default int field postfix.static final String
The default local field postfix.static final String
The default field postfix for alpha-numeric sorting.static final String
The default string field postfix.static final String
The prefix used to store dependency fields.static final String
The prefix for dynamic fields.static final String
The default text field prefix.static final String
Name of the field that contains the (optional) document priority, which can be used to boost the document in the result list (hardcoded).static final String
Name of the field that contains the resource locales of the document.static final String
The name of the score field.static final String
static final String
Name of the field that contains the searched property value of 'search.exclude'.static final String
The field where the dates for a serial date are stored.static final String
The field where the dates until when the single serial dates are treated as "current" are stored.static final String
The field where the end dates for a serial date are stored.static final String
The field where the type of the date series is stored.static final String
Name of the field that usually contains file size.static final String
Name of the field that contains the unique Solr id.static final String
Name of the field that contains the lower-case title, untokenized, for sorting.static final String
static final String
Name of the field that contains the resource state.static final String
Name of the field that contains the file name suffix of the resource.static final String
Name of the field that contains the general text of a resource and also serves as prefix.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Name of the field that usually contains the value of the "Title" property of the document as a keyword used for sorting and also for retrieving the title text (optional).static final String
Name of the field that usually contains the value of the "Title" property of the document in an analyzed form used for searching in the title (optional).static final String
Name of the field that contains the type of the document.static final String
Name of the field that contains the user created.static final String
Name of the field that contains the user last modified.static final String
Name of the field that contains the latest version number of the resource. -
Constructor Summary
ConstructorDescriptionCreates a new search field.CmsSearchField
(String name, String defaultValue) Creates a new search field. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMapping
(I_CmsSearchFieldMapping mapping) Adds a new field mapping to the internal list of mappings.static void
addUninvertingMappings
(Map<String, org.apache.solr.uninverting.UninvertingReader.Type> uninvertingMap) To allow sorting on a field the field must be added to the map given toUninvertingReader.wrap(org.apache.lucene.index.DirectoryReader, Map)
.boolean
Two fields are equal if the name of the Lucene field is equal.Returns the default value to use if no content for this field was collected.Returns the String value state of this field if it is indexed (and possibly tokenized) in the index.Returns the mappings for this field.getName()
Returns the name of this field in the Lucene search index.int
hashCode()
The hash code for a field is based only on the field name.boolean
Returns the indexed.boolean
Returnstrue
if this fields content is used in the search result excerpt.boolean
isStored()
Returnstrue
if the content of this field is stored in the Lucene index.void
setDefaultValue
(String defaultValue) Sets the default value to use if no content for this field was collected.void
setIndexed
(boolean indexed) Controls if the content of this field is indexed (and possibly tokenized) in the Lucene index.void
setInExcerpt
(boolean excerpt) Controls if this fields content is used in the search result excerpt.void
Sets the name of this field in the Lucene search index.void
setStored
(boolean stored) Controls if the content of this field is stored in the Lucene index.toString()
-
Field Details
-
FIELD_CATEGORY
Name of the field that contains the (optional) category of the document (hardcoded).- See Also:
-
FIELD_CONTENT
Name of the field that usually contains the complete content of the document (optional).- See Also:
-
FIELD_CONTENT_BLOB
Name of the field that contains the complete extracted content of the document as serialized object (hardcoded).- See Also:
-
FIELD_CONTENT_LOCALES
Name of the field that contains the locale of the document.- See Also:
-
FIELD_DATE_CONTENT
Name of the field that contains the document content date (hardcoded).- See Also:
-
FIELD_DATE_CREATED
Name of the field that contains the document creation date (hardcoded).- See Also:
-
FIELD_DATE_CREATED_LOOKUP
Name of the field that contains the document creation date for fast lookup (hardcoded).- See Also:
-
FIELD_DATE_EXPIRED
The field name for the expiration date.- See Also:
-
FIELD_DATE_LASTMODIFIED
Name of the field that contains the document last modification date (hardcoded).- See Also:
-
FIELD_DATE_LASTMODIFIED_LOOKUP
Name of the field that contains the document last modification date for fast lookup (hardcoded).- See Also:
-
FIELD_DATE_LOOKUP_SUFFIX
The lookup suffix for date fields.- See Also:
-
FIELD_DATE_RELEASED
The field name for the release date.- See Also:
-
FIELD_DEPENDENCY_TYPE
The dependency type.- See Also:
-
FIELD_DESCRIPTION
Name of the field that usually contains the value of the "Description" property of the document (optional).- See Also:
-
FIELD_DYNAMIC_EXACT
Name of the dynamic exact field.- See Also:
-
FIELD_DYNAMIC_PROPERTIES
Name of the dynamic property field (searched properties).- See Also:
-
FIELD_DYNAMIC_PROPERTIES_DIRECT
Name of the dynamic property field (non-searched properties).- See Also:
-
FIELD_EXCERPT
The name of the dynamic field that stores the shortened value of the content field in order to save performance.- See Also:
-
FIELD_FILENAME
Name of the field that contains the filename.- See Also:
-
FIELD_ID
Name of the field that contains the documents structure id.- See Also:
-
FIELD_KEYWORDS
Name of the field that usually contains the value of the "Keywords" property of the document (optional).- See Also:
-
FIELD_LINK
The field name for the link.- See Also:
-
FIELD_META
Name of the field that usually combines all document "meta" information, that is the values of the "Title", "Keywords" and "Description" properties (optional).- See Also:
-
FIELD_MIMETYPE
Name of the field that contains the mime type.- See Also:
-
FIELD_PARENT_FOLDERS
Name of the field that contains all VFS parent folders of a document (hardcoded).- See Also:
-
FIELD_PATH
Name of the field that contains the document root path in the VFS (hardcoded).- See Also:
-
FIELD_PREFIX_DEPENDENCY
The prefix used to store dependency fields.- See Also:
-
FIELD_PREFIX_DYNAMIC
The prefix for dynamic fields.- See Also:
-
FIELD_PREFIX_TEXT
The default text field prefix.- See Also:
-
FIELD_POSTFIX_STRING
The default string field postfix.- See Also:
-
FIELD_POSTFIX_DATE
The default (single-valued) date field postfix.- See Also:
-
FIELD_POSTFIX_DATES
The default (multi-valued) dates field postfix.- See Also:
-
FIELD_POSTFIX_DATE_RANGE
The default (single-valued) date range field postfix.- See Also:
-
FIELD_POSTFIX_DATE_RANGES
The default (multi-valued) date range field postfix.- See Also:
-
FIELD_POSTFIX_INT
The default int field postfix.- See Also:
-
FIELD_POSTFIX_LOC
The default local field postfix.- See Also:
-
FIELD_POSTFIX_SORT
The default field postfix for alpha-numeric sorting.- See Also:
-
FIELD_PRIORITY
Name of the field that contains the (optional) document priority, which can be used to boost the document in the result list (hardcoded).- See Also:
-
FIELD_RESOURCE_LOCALES
Name of the field that contains the resource locales of the document.- See Also:
-
FIELD_SCORE
The name of the score field.- See Also:
-
FIELD_SEARCH_EXCLUDE
Name of the field that contains the searched property value of 'search.exclude'.- See Also:
-
FIELD_SIZE
Name of the field that usually contains file size.- See Also:
-
FIELD_SORT_TITLE
Name of the field that contains the lower-case title, untokenized, for sorting.- See Also:
-
FIELD_STATE
Name of the field that contains the resource state.- See Also:
-
FIELD_SUFFIX
Name of the field that contains the file name suffix of the resource.- See Also:
-
FIELD_TEXT
Name of the field that contains the general text of a resource and also serves as prefix.- See Also:
-
FIELD_TITLE
Name of the field that usually contains the value of the "Title" property of the document as a keyword used for sorting and also for retrieving the title text (optional). Please note: This field should NOT be used for searching. UseFIELD_TITLE_UNSTORED
instead.- See Also:
-
FIELD_TITLE_UNSTORED
Name of the field that usually contains the value of the "Title" property of the document in an analyzed form used for searching in the title (optional).- See Also:
-
FIELD_TIMESTAMP
- See Also:
-
FIELD_PATH_HIERARCHY
- See Also:
-
FIELD_CATEGORY_EXACT
- See Also:
-
FIELD_PLACE
- See Also:
-
FIELD_SPELL
- See Also:
-
FIELD_TEXT_EN
- See Also:
-
FIELD_TEXT_DE
- See Also:
-
FIELD_TEXT_EL
- See Also:
-
FIELD_TEXT_ES
- See Also:
-
FIELD_TEXT_FR
- See Also:
-
FIELD_TEXT_HU
- See Also:
-
FIELD_TEXT_IT
- See Also:
-
FIELD_SEARCH_CHANNEL
- See Also:
-
FIELD_DISPTITLE
The field PREFIX of the fields that contain the display title (without locale and postfix "_s").- See Also:
-
FIELD_DISPORDER
The field PREFIX of the fields that contain the display order (without locale and postfix "_i").- See Also:
-
FIELD_GEOCOORDS
Name of the field that contains Geo coordinates.- See Also:
-
FIELD_INSTANCEDATE
The field PREFIX where the start date for the single entry of a serial date entry set is stored.- See Also:
-
FIELD_INSTANCEDATE_END
The field PREFIX where the end date for the single entry of a serial date entry set is stored.- See Also:
-
FIELD_INSTANCEDATE_CURRENT_TILL
The field PREFIX where the date until which the single entry of a serial date entry should be treated as "current" is stored.- See Also:
-
FIELD_INSTANCEDATE_RANGE
The field PREFIX where the start date and the end date of the single entry of a serial date entry is stored as a date range.- See Also:
-
FIELD_SERIESDATES
The field where the dates for a serial date are stored.- See Also:
-
FIELD_SERIESDATES_END
The field where the end dates for a serial date are stored. NOTE: The field is only used during indexing and not stored in the content itself.- See Also:
-
FIELD_SERIESDATES_CURRENT_TILL
The field where the dates until when the single serial dates are treated as "current" are stored. NOTE: The field is only used during indexing and not stored in the content itself.- See Also:
-
FIELD_SERIESDATES_TYPE
The field where the type of the date series is stored.- See Also:
-
FIELD_TYPE
Name of the field that contains the type of the document.- See Also:
-
FIELD_USER_CREATED
Name of the field that contains the user created.- See Also:
-
FIELD_USER_LAST_MODIFIED
Name of the field that contains the user last modified.- See Also:
-
FIELD_VERSION
Name of the field that contains the latest version number of the resource.- See Also:
-
FIELD_SOLR_ID
Name of the field that contains the unique Solr id.- See Also:
-
-
Constructor Details
-
CmsSearchField
public CmsSearchField()Creates a new search field. -
CmsSearchField
Creates a new search field.- Parameters:
name
- the name of the field, seesetName(String)
defaultValue
- the default value to use, seesetDefaultValue(String)
-
-
Method Details
-
addUninvertingMappings
public static void addUninvertingMappings(Map<String, org.apache.solr.uninverting.UninvertingReader.Type> uninvertingMap) To allow sorting on a field the field must be added to the map given toUninvertingReader.wrap(org.apache.lucene.index.DirectoryReader, Map)
. The method adds all default fields.- Parameters:
uninvertingMap
- the map to which the fields are added.
-
addMapping
Adds a new field mapping to the internal list of mappings.- Parameters:
mapping
- the mapping to add
-
equals
Two fields are equal if the name of the Lucene field is equal. -
getDefaultValue
Returns the default value to use if no content for this field was collected.In case no default is configured,
null
is returned.- Returns:
- the default value to use if no content for this field was collected
-
getIndexed
Returns the String value state of this field if it is indexed (and possibly tokenized) in the index.IMPORTANT: Not supported by Solr
- Returns:
- the String value state of this field if it is indexed (and possibly tokenized) in the index
-
getMappings
Returns the mappings for this field.- Returns:
- the mappings for this field
-
getName
Returns the name of this field in the Lucene search index.- Returns:
- the name of this field in the Lucene search index
-
hashCode
The hash code for a field is based only on the field name. -
isIndexed
Returns the indexed.- Returns:
- the indexed
-
isInExcerpt
Returnstrue
if this fields content is used in the search result excerpt.- Returns:
true
if this fields content is used in the search result excerpt- See Also:
-
isStored
Returnstrue
if the content of this field is stored in the Lucene index.Please refer to the Lucene documentation about
Field.Store
for the concept behind stored and unstored fields.- Returns:
true
if the content of this field is stored in the Lucene index
-
setDefaultValue
Sets the default value to use if no content for this field was collected.- Parameters:
defaultValue
- the default value to set
-
setIndexed
Controls if the content of this field is indexed (and possibly tokenized) in the Lucene index.- Parameters:
indexed
- the indexed to set
-
setInExcerpt
Controls if this fields content is used in the search result excerpt.- Parameters:
excerpt
- iftrue
, then this fields content is used in the search excerpt
-
setName
Sets the name of this field in the Lucene search index.- Parameters:
fieldName
- the name to set
-
setStored
Controls if the content of this field is stored in the Lucene index.Please refer to the Lucene documentation about
Field.Store
for the concept behind stored and unstored fields.- Parameters:
stored
- iftrue
, then the field content is stored
-
toString
-