|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.search.fields.CmsSearchFieldConfiguration
public class CmsSearchFieldConfiguration
Describes a configuration of fields that are used in building a search index.
Field Summary | |
---|---|
static CmsSearchFieldConfiguration |
DEFAULT_STANDARD
The default for the standard search configuration. |
static java.lang.String |
SEARCH_PRIORITY_HIGH_VALUE
Value for "high" search priority. |
static java.lang.String |
SEARCH_PRIORITY_LOW_VALUE
Value for "low" search priority. |
static java.lang.String |
SEARCH_PRIORITY_MAX_VALUE
Value for "maximum" search priority. |
static java.lang.String |
SEARCH_PRIORITY_NORMAL_VALUE
Value for "normal" search priority. |
static java.lang.String |
STR_STANDARD
The name for the standard field configuration. |
static java.lang.String |
STR_STANDARD_DESCRIPTION
The description for the standard field configuration. |
static java.lang.String |
VFS_DOCUMENT_KEY_PREFIX
The VFS prefix for document keys. |
Constructor Summary | |
---|---|
CmsSearchFieldConfiguration()
Creates a new, empty field configuration. |
Method Summary | |
---|---|
void |
addField(CmsSearchField field)
Adds a field to this search field configuration. |
int |
compareTo(CmsSearchFieldConfiguration obj)
|
org.apache.lucene.document.Document |
createDocument(CmsObject cms,
CmsResource resource,
CmsSearchIndex index,
I_CmsExtractionResult content)
Creates the Lucene Document with this field configuration for the provided VFS resource, search index and content. |
boolean |
equals(java.lang.Object obj)
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Returns an analyzer that wraps the given base analyzer with the analyzers of this individual field configuration. |
protected org.apache.lucene.analysis.Analyzer |
getAnalyzerForDefaultFields(org.apache.lucene.analysis.Analyzer analyzer)
Returns an analyzer that wraps the given base analyzer with special analyzers required for the hard coded document fields. |
java.lang.String |
getDescription()
Returns the description of this field configuration. |
java.util.List<java.lang.String> |
getExcerptFieldNames()
Returns a list of all field names (Strings) that are used in generating the search excerpt. |
CmsSearchField |
getField(java.lang.String name)
Returns the configured CmsSearchField instance with the given name. |
java.util.List<java.lang.String> |
getFieldNames()
Returns the list of configured field names (Strings). |
java.util.List<CmsSearchField> |
getFields()
Returns the list of configured CmsSearchField instances. |
java.lang.String |
getName()
Returns the name of this field configuration. |
static java.lang.String |
getParentFolderTokens(java.lang.String rootPath)
Creates a space separated list of all parent folders of the given root path. |
int |
hashCode()
|
void |
setDescription(java.lang.String description)
Sets the description of this field configuration. |
void |
setName(java.lang.String name)
Sets the name of this field configuration. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CmsSearchFieldConfiguration DEFAULT_STANDARD
This defines the default that is used in case no "standard" field configuration
is defined in opencms-search.xml
.
public static final java.lang.String SEARCH_PRIORITY_HIGH_VALUE
public static final java.lang.String SEARCH_PRIORITY_LOW_VALUE
public static final java.lang.String SEARCH_PRIORITY_MAX_VALUE
public static final java.lang.String SEARCH_PRIORITY_NORMAL_VALUE
public static final java.lang.String STR_STANDARD
public static final java.lang.String STR_STANDARD_DESCRIPTION
public static final java.lang.String VFS_DOCUMENT_KEY_PREFIX
Constructor Detail |
---|
public CmsSearchFieldConfiguration()
Method Detail |
---|
public static java.lang.String getParentFolderTokens(java.lang.String rootPath)
rootPath
- the root path to get the parent folder list for
public void addField(CmsSearchField field)
field
- the field to addpublic int compareTo(CmsSearchFieldConfiguration obj)
compareTo
in interface java.lang.Comparable<CmsSearchFieldConfiguration>
Comparable.compareTo(java.lang.Object)
public org.apache.lucene.document.Document createDocument(CmsObject cms, CmsResource resource, CmsSearchIndex index, I_CmsExtractionResult content) throws CmsException
This triggers the indexing process for the given VFS resource according to the configuration of the provided index.
The provided index resource contains the basic contents to index. The provided search index contains the configuration what to index, such as the locale and possible special field mappings.
cms
- the OpenCms user context used to access the OpenCms VFSresource
- the resource to create the Lucene document fromindex
- the search index to create the Document forcontent
- the plain text content extracted from the document
CmsException
- if something goes wrongpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public org.apache.lucene.analysis.Analyzer getAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
- the base analyzer to wrap
public java.lang.String getDescription()
public java.util.List<java.lang.String> getExcerptFieldNames()
public CmsSearchField getField(java.lang.String name)
CmsSearchField
instance with the given name.
name
- the search field name to look up
CmsSearchField
instance with the given namepublic java.util.List<java.lang.String> getFieldNames()
public java.util.List<CmsSearchField> getFields()
CmsSearchField
instances.
CmsSearchField
instancespublic java.lang.String getName()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public void setDescription(java.lang.String description)
description
- the description to setpublic void setName(java.lang.String name)
name
- the name to setprotected org.apache.lucene.analysis.Analyzer getAnalyzerForDefaultFields(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
- the base analyzer to wrap
getAnalyzer(Analyzer)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |