public class CmsSearchField
extends java.lang.Object
implements java.io.Serializable
限定符和类型 | 字段和说明 |
---|---|
static float |
BOOST_DEFAULT
Th default boost factor (1.0), used in case no boost has been set for a field.
|
static java.lang.String |
FIELD_CATEGORY
Name of the field that contains the (optional) category of the document (hardcoded).
|
static java.lang.String |
FIELD_CONTENT
Name of the field that usually contains the complete content of the document (optional).
|
static java.lang.String |
FIELD_CONTENT_BLOB
Name of the field that contains the complete extracted content of the document as serialized object (hardcoded).
|
static java.lang.String |
FIELD_CONTENT_LOCALES
Name of the field that contains the locale of the document.
|
static java.lang.String |
FIELD_DATE_CONTENT
Name of the field that contains the document content date (hardcoded).
|
static java.lang.String |
FIELD_DATE_CREATED
Name of the field that contains the document creation date (hardcoded).
|
static java.lang.String |
FIELD_DATE_CREATED_LOOKUP
Name of the field that contains the document creation date for fast lookup (hardcoded).
|
static java.lang.String |
FIELD_DATE_EXPIRED
The field name for the expiration date.
|
static java.lang.String |
FIELD_DATE_LASTMODIFIED
Name of the field that contains the document last modification date (hardcoded).
|
static java.lang.String |
FIELD_DATE_LASTMODIFIED_LOOKUP
Name of the field that contains the document last modification date for fast lookup (hardcoded).
|
static java.lang.String |
FIELD_DATE_LOOKUP_SUFFIX
The lookup suffix for date fields.
|
static java.lang.String |
FIELD_DATE_RELEASED
The field name for the release date.
|
static java.lang.String |
FIELD_DEPENDENCY_TYPE
The dependency type.
|
static java.lang.String |
FIELD_DESCRIPTION
Name of the field that usually contains the value of the "Description" property of the document (optional).
|
static java.lang.String |
FIELD_DYNAMIC_EXACT
Name of the dynamic exact field.
|
static java.lang.String |
FIELD_DYNAMIC_PROPERTIES
Name of the dynamic property field.
|
static java.lang.String |
FIELD_EXCERPT
The name of the dynamic field that stores the shortened value of the content field in order to save performance.
|
static java.lang.String |
FIELD_FILENAME
Name of the field that contains the filename.
|
static java.lang.String |
FIELD_ID
Name of the field that contains the documents structure id.
|
static java.lang.String |
FIELD_KEYWORDS
Name of the field that usually contains the value of the "Keywords" property of the document (optional).
|
static java.lang.String |
FIELD_LINK
The field name for the link.
|
static java.lang.String |
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).
|
static java.lang.String |
FIELD_MIMETYPE
Name of the field that contains the mime type.
|
static java.lang.String |
FIELD_PARENT_FOLDERS
Name of the field that contains all VFS parent folders of a document (hardcoded).
|
static java.lang.String |
FIELD_PATH
Name of the field that contains the document root path in the VFS (hardcoded).
|
static java.lang.String |
FIELD_PREFIX_DEPENDENCY
The prefix used to store dependency fields.
|
static java.lang.String |
FIELD_PREFIX_DYNAMIC
The prefix for dynamic fields.
|
static java.lang.String |
FIELD_PREFIX_TEXT
The default text field prefix.
|
static java.lang.String |
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).
|
static java.lang.String |
FIELD_RESOURCE_LOCALES
Name of the field that contains the resource locales of the document.
|
static java.lang.String |
FIELD_SCORE
The name of the score field.
|
static java.lang.String |
FIELD_SEARCH_EXCLUDE
Name of the field that contains the searched property value of 'search.exclude'.
|
static java.lang.String |
FIELD_SIZE
Name of the field that usually contains file size.
|
static java.lang.String |
FIELD_SORT_TITLE
Name of the field that contains the lower-case title, untokenized, for sorting.
|
static java.lang.String |
FIELD_STATE
Name of the field that contains the resource state.
|
static java.lang.String |
FIELD_SUFFIX
Name of the field that contains the file name suffix of the resource.
|
static java.lang.String |
FIELD_TEXT
Name of the field that contains the general text of a resource and also serves as prefix.
|
static java.lang.String |
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).
|
static java.lang.String |
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).
|
static java.lang.String |
FIELD_TYPE
Name of the field that contains the type of the document.
|
static java.lang.String |
FIELD_USER_CREATED
Name of the field that contains the user created.
|
static java.lang.String |
FIELD_USER_LAST_MODIFIED
Name of the field that contains the user last modified.
|
static java.lang.String |
FIELD_VERSION
Name of the field that contains the latest version number of the resource.
|
构造器和说明 |
---|
CmsSearchField()
Creates a new search field.
|
CmsSearchField(java.lang.String name,
java.lang.String defaultValue,
float boost)
Creates a new search field.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addMapping(I_CmsSearchFieldMapping mapping)
Adds a new field mapping to the internal list of mappings.
|
boolean |
equals(java.lang.Object obj)
Two fields are equal if the name of the Lucene field is equal.
|
float |
getBoost()
Returns the boost factor of this field.
|
java.lang.String |
getDefaultValue()
Returns the default value to use if no content for this field was collected.
|
java.lang.String |
getIndexed()
Returns the String value state of this field if it is indexed (and possibly tokenized) in the index.
|
java.util.List<I_CmsSearchFieldMapping> |
getMappings()
Returns the mappings for this field.
|
java.lang.String |
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 |
isIndexed()
Returns the indexed.
|
boolean |
isInExcerpt()
Returns
true if this fields content is used in the search result excerpt. |
boolean |
isStored()
Returns
true if the content of this field is stored in the Lucene index. |
void |
setBoost(float boost)
Sets the boost factor for this field.
|
void |
setBoost(java.lang.String boostAsString)
Sets the boost factor for this field from a String value.
|
void |
setDefaultValue(java.lang.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 |
setName(java.lang.String fieldName)
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.
|
java.lang.String |
toString() |
public static final float BOOST_DEFAULT
public static final java.lang.String FIELD_CATEGORY
public static final java.lang.String FIELD_CONTENT
public static final java.lang.String FIELD_CONTENT_BLOB
public static final java.lang.String FIELD_CONTENT_LOCALES
public static final java.lang.String FIELD_DATE_CONTENT
public static final java.lang.String FIELD_DATE_CREATED
public static final java.lang.String FIELD_DATE_CREATED_LOOKUP
public static final java.lang.String FIELD_DATE_EXPIRED
public static final java.lang.String FIELD_DATE_LASTMODIFIED
public static final java.lang.String FIELD_DATE_LASTMODIFIED_LOOKUP
public static final java.lang.String FIELD_DATE_LOOKUP_SUFFIX
public static final java.lang.String FIELD_DATE_RELEASED
public static final java.lang.String FIELD_DEPENDENCY_TYPE
public static final java.lang.String FIELD_DESCRIPTION
public static final java.lang.String FIELD_DYNAMIC_EXACT
public static final java.lang.String FIELD_DYNAMIC_PROPERTIES
public static final java.lang.String FIELD_EXCERPT
public static final java.lang.String FIELD_FILENAME
public static final java.lang.String FIELD_ID
public static final java.lang.String FIELD_KEYWORDS
public static final java.lang.String FIELD_LINK
public static final java.lang.String FIELD_META
public static final java.lang.String FIELD_MIMETYPE
public static final java.lang.String FIELD_PARENT_FOLDERS
public static final java.lang.String FIELD_PATH
public static final java.lang.String FIELD_PREFIX_DEPENDENCY
public static final java.lang.String FIELD_PREFIX_DYNAMIC
public static final java.lang.String FIELD_PREFIX_TEXT
public static final java.lang.String FIELD_PRIORITY
public static final java.lang.String FIELD_RESOURCE_LOCALES
public static final java.lang.String FIELD_SCORE
public static final java.lang.String FIELD_SEARCH_EXCLUDE
public static final java.lang.String FIELD_SIZE
public static final java.lang.String FIELD_SORT_TITLE
public static final java.lang.String FIELD_STATE
public static final java.lang.String FIELD_SUFFIX
public static final java.lang.String FIELD_TEXT
public static final java.lang.String FIELD_TITLE
FIELD_TITLE_UNSTORED
instead.public static final java.lang.String FIELD_TITLE_UNSTORED
public static final java.lang.String FIELD_TYPE
public static final java.lang.String FIELD_USER_CREATED
public static final java.lang.String FIELD_USER_LAST_MODIFIED
public static final java.lang.String FIELD_VERSION
public CmsSearchField()
public CmsSearchField(java.lang.String name, java.lang.String defaultValue, float boost)
name
- the name of the field, see setName(String)
defaultValue
- the default value to use, see setDefaultValue(String)
boost
- the boost factor, see setBoost(float)
public void addMapping(I_CmsSearchFieldMapping mapping)
mapping
- the mapping to addpublic boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
Object.equals(java.lang.Object)
public float getBoost()
The boost factor is a Lucene function that controls the "importance" of a field in the
search result ranking. The default is 1.0
. A lower boost factor will make the field
less important for the result ranking, a higher value will make it more important.
public java.lang.String getDefaultValue()
In case no default is configured, null
is returned.
public java.lang.String getIndexed()
IMPORTANT: Not supported by Solr
public java.util.List<I_CmsSearchFieldMapping> getMappings()
public java.lang.String getName()
public int hashCode()
hashCode
在类中 java.lang.Object
Object.hashCode()
public boolean isIndexed()
public boolean isInExcerpt()
true
if this fields content is used in the search result excerpt.true
if this fields content is used in the search result excerptisStored()
public boolean isStored()
true
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.
true
if the content of this field is stored in the Lucene indexpublic void setBoost(float boost)
The boost factor is a Lucene function that controls the "importance" of a field in the
search result ranking. The default is 1.0
. A lower boost factor will make the field
less important for the result ranking, a higher value will make it more important.
Use with caution: You should only use this if you fully understand the concept behind boost factors. Otherwise it is likely that your result rankings will be worse then with the default values.
boost
- the boost factor to setpublic void setBoost(java.lang.String boostAsString)
boostAsString
- the boost factor to setsetBoost(float)
public void setDefaultValue(java.lang.String defaultValue)
defaultValue
- the default value to setpublic void setIndexed(boolean indexed)
indexed
- the indexed to setpublic void setInExcerpt(boolean excerpt)
excerpt
- if true
, then this fields content is used in the search excerptpublic void setName(java.lang.String fieldName)
fieldName
- the name to setpublic void setStored(boolean stored)
Please refer to the Lucene documentation about Field.Store
for the concept behind stored and unstored fields.
stored
- if true
, then the field content is storedpublic java.lang.String toString()
toString
在类中 java.lang.Object
Object.toString()