|
||||||||
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 String |
SEARCH_PRIORITY_HIGH_VALUE
Value for "high" search priority. |
static String |
SEARCH_PRIORITY_LOW_VALUE
Value for "low" search priority. |
static String |
SEARCH_PRIORITY_MAX_VALUE
Value for "maximum" search priority. |
static String |
SEARCH_PRIORITY_NORMAL_VALUE
Value for "normal" search priority. |
static String |
STR_STANDARD
The name for the standard field configuration. |
static String |
STR_STANDARD_DESCRIPTION
The description for the standard field configuration. |
static 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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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,
List<CmsProperty> properties,
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(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. |
static String |
getDateTerms(long date)
Generate a list of date terms for the optimized date range search. |
String |
getDescription()
Returns the description of this field configuration. |
List<String> |
getExcerptFieldNames()
Returns a list of all field names (Strings) that are used in generating the search excerpt. |
CmsSearchField |
getField(String name)
Returns the configured CmsSearchField instance with the given name. |
List<String> |
getFieldNames()
Returns the list of configured field names (Strings). |
List<CmsSearchField> |
getFields()
Returns the list of configured CmsSearchField instances. |
String |
getName()
Returns the name of this field configuration. |
static String |
getParentFolderTokens(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,
List<CmsProperty> properties,
List<CmsProperty> propertiesSearched)
Extends the given document with a boost factor. |
void |
setDescription(String description)
Sets the description of this field configuration. |
void |
setName(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 String SEARCH_PRIORITY_HIGH_VALUE
public static final String SEARCH_PRIORITY_LOW_VALUE
public static final String SEARCH_PRIORITY_MAX_VALUE
public static final String SEARCH_PRIORITY_NORMAL_VALUE
public static final String STR_STANDARD
public static final String STR_STANDARD_DESCRIPTION
public static final String VFS_DOCUMENT_KEY_PREFIX
Constructor Detail |
---|
public CmsSearchFieldConfiguration()
Method Detail |
---|
public static String getDateTerms(long date)
date
- the date for get the date terms for
CmsSearchIndex.getDateRangeSpan(long, long)
public static String getParentFolderTokens(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 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(Object obj)
equals
in class 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 String getDescription()
public List<String> getExcerptFieldNames()
public CmsSearchField getField(String name)
CmsSearchField
instance with the given name.
name
- the search field name to look up
CmsSearchField
instance with the given namepublic List<String> getFieldNames()
public List<CmsSearchField> getFields()
CmsSearchField
instances.
CmsSearchField
instancespublic String getName()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void setDescription(String description)
description
- the description to setpublic void setName(String name)
name
- the name to setprotected org.apache.lucene.document.Document appendCategories(org.apache.lucene.document.Document document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, 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 categoriesprotected org.apache.lucene.document.Document appendContentBlob(org.apache.lucene.document.Document document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, 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, List<CmsProperty> properties, 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, List<CmsProperty> properties, 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, List<CmsProperty> properties, 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, List<CmsProperty> properties, 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, List<CmsProperty> properties, 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 nameprotected org.apache.lucene.analysis.Analyzer getAnalyzerForDefaultFields(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
- the base analyzer to wrap
getAnalyzer(Analyzer)
protected org.apache.lucene.document.Document setBoost(org.apache.lucene.document.Document document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, 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 |