|
||||||||
| 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. |
protected org.apache.lucene.document.Document |
appendCategories(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by resource category information. |
protected org.apache.lucene.document.Document |
appendContentBlob(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by a field that contains the extracted content blob. |
protected org.apache.lucene.document.Document |
appendDates(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by fields for date of creation, content and last modification. |
protected org.apache.lucene.document.Document |
appendFieldMapping(org.apache.lucene.document.Document document,
CmsSearchField fieldConfig,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by the mappings for the given field. |
protected org.apache.lucene.document.Document |
appendFieldMappings(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by the configured field mappings. |
protected org.apache.lucene.document.Document |
appendPath(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by fields for VFS path lookup. |
protected org.apache.lucene.document.Document |
appendType(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document by a field that contains the resource type name. |
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. |
static java.lang.String |
getDateTerms(long date)
Generate a list of date terms for the optimized date range search. |
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()
|
protected org.apache.lucene.document.Document |
setBoost(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
Extends the given document with a boost factor. |
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 getDateTerms(long date)
date - the date for get the date terms for
CmsSearchIndex.getDateRangeSpan(long, long)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.ObjectObject.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.ObjectObject.hashCode()public void setDescription(java.lang.String description)
description - the description to setpublic void setName(java.lang.String name)
name - the name to set
protected org.apache.lucene.document.Document appendCategories(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
throws CmsException
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
CmsException - in case of an error accessing the resource categories
protected org.apache.lucene.document.Document appendContentBlob(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
protected org.apache.lucene.document.Document appendDates(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
protected org.apache.lucene.document.Document appendFieldMapping(org.apache.lucene.document.Document document,
CmsSearchField fieldConfig,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendfieldConfig - the field to create the mappings forcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
protected org.apache.lucene.document.Document appendFieldMappings(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
protected org.apache.lucene.document.Document appendPath(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
protected org.apache.lucene.document.Document appendType(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
throws CmsLoaderException
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
CmsLoaderException - in case of errors identifying the resource type name
protected org.apache.lucene.document.Document setBoost(org.apache.lucene.document.Document document,
CmsObject cms,
CmsResource resource,
I_CmsExtractionResult extractionResult,
java.util.List<CmsProperty> properties,
java.util.List<CmsProperty> propertiesSearched)
document - the document to extendcms - the OpenCms context used for building the search indexresource - the resource that is indexedextractionResult - the plain text extraction result from the resourceproperties - the list of all properties directly attached to the resource (not searched)propertiesSearched - the list of all searched properties of the resource
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||