|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.search.CmsSearchIndex
public class CmsSearchIndex
Implements the search within an index and the management of the index configuration.
Nested Class Summary | |
---|---|
protected class |
CmsSearchIndex.LazyContentReader
Lucene filter index reader implementation that will ensure the OpenCms default search index fields CmsSearchField.FIELD_CONTENT and CmsSearchField.FIELD_CONTENT_BLOB
are lazy loaded. |
Field Summary | |
---|---|
static String |
BACKUP_REINDEXING
Constant for additional parameter to enable optimized full index regeneration (default: false). |
protected static org.apache.lucene.document.FieldSelector |
CONTENT_SELECTOR
Field selector for Lucene that that will ensure the OpenCms default search index fields CmsSearchField.FIELD_CONTENT and CmsSearchField.FIELD_CONTENT_BLOB
are lazy loaded. |
static String[] |
DATES
Look table to quickly zero-pad days / months in date Strings. |
static String[] |
DOC_META_FIELDS
Constant for a field list that contains the "meta" field as well as the "content" field. |
static String |
EXCERPT
Constant for additional parameter to enable excerpt creation (default: true). |
static String |
EXTRACT_CONTENT
Constant for additional parameter for index content extraction. |
static String |
LUCENE_AUTO_COMMIT
Constant for additional parameter for the Lucene index setting. |
static String |
LUCENE_MAX_MERGE_DOCS
Constant for additional parameter for the Lucene index setting. |
static String |
LUCENE_MERGE_FACTOR
Constant for additional parameter for the Lucene index setting. |
static String |
LUCENE_RAM_BUFFER_SIZE_MB
Constant for additional parameter for the Lucene index setting. |
static String |
LUCENE_USE_COMPOUND_FILE
Constant for additional parameter for the Lucene index setting. |
static org.apache.lucene.util.Version |
LUCENE_VERSION
The Lucene Version used to create Query parsers and such. |
protected boolean |
m_requireViewPermission
Controls if a resource requires view permission to be displayed in the result list. |
protected List<CmsSearchIndexSource> |
m_sources
The list of configured index sources. |
static String |
MAX_HITS
Constant for additional parameter for controlling how many hits are loaded at maximum (default: 1000). |
static int |
MAX_HITS_DEFAULT
Indicates how many hits are loaded at maximum by default. |
static int |
MAX_YEAR_RANGE
Constant for years max range span in document search. |
static String |
PERMISSIONS
Constant for additional parameter to enable permission checks (default: true). |
static String |
PRIORITY
Constant for additional parameter to set the thread priority during search. |
static String |
PROPERTY_SEARCH_EXCLUDE_VALUE_ALL
Special value for the search.exclude property. |
static String |
PROPERTY_SEARCH_EXCLUDE_VALUE_GALLERY
Special value for the search.exclude property. |
static String |
REBUILD_MODE_AUTO
Automatic ("auto") index rebuild mode. |
static String |
REBUILD_MODE_MANUAL
Manual ("manual") index rebuild mode. |
static String |
REBUILD_MODE_OFFLINE
Offline ("offline") index rebuild mode. |
static String |
TIME_RANGE
Constant for additional parameter to enable time range checks (default: true). |
static String |
USE_ALL_LOCALE
The use all locale. |
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler |
---|
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD |
Constructor Summary | |
---|---|
CmsSearchIndex()
Default constructor only intended to be used by the XML configuration. |
|
CmsSearchIndex(String name)
Creates a new CmsSearchIndex with the given name. |
Method Summary | |
---|---|
void |
addConfigurationParameter(String key,
String value)
Adds a parameter. |
void |
addSourceName(String sourceName)
Adds am index source to this search index. |
protected org.apache.lucene.search.BooleanFilter |
appendCategoryFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
List<String> categories)
Appends the a category filter to the given filter clause that matches all given categories. |
protected org.apache.lucene.search.BooleanFilter |
appendDateCreatedFilter(org.apache.lucene.search.BooleanFilter filter,
long startTime,
long endTime)
Appends a date of creation filter to the given filter clause that matches the given time range. |
protected org.apache.lucene.search.BooleanFilter |
appendDateLastModifiedFilter(org.apache.lucene.search.BooleanFilter filter,
long startTime,
long endTime)
Appends a date of last modification filter to the given filter clause that matches the given time range. |
protected org.apache.lucene.search.BooleanFilter |
appendPathFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
List<String> roots)
Appends the a VFS path filter to the given filter clause that matches all given root paths. |
protected org.apache.lucene.search.BooleanFilter |
appendResourceTypeFilter(CmsObject cms,
org.apache.lucene.search.BooleanFilter filter,
List<String> resourceTypes)
Appends the a resource type filter to the given filter clause that matches all given resource types. |
boolean |
checkConfiguration(CmsObject cms)
Checks is this index has been configured correctly. |
protected org.apache.lucene.search.Filter |
createDateRangeFilter(String fieldName,
long startTime,
long endTime)
Creates an optimized date range filter for the date of last modification or creation. |
protected String |
createIndexBackup()
Creates a backup of this index for optimized re-indexing of the whole content. |
boolean |
equals(Object obj)
|
protected boolean |
excludeFromIndex(CmsObject cms,
CmsResource resource)
Checks if the provided resource should be excluded from this search index. |
protected void |
extendPathFilter(org.apache.lucene.search.TermsFilter pathFilter,
String searchRoot)
Extends the given path query with another term for the given search root element. |
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
Returns the Lucene analyzer used for this index. |
CmsParameterConfiguration |
getConfiguration()
Returns the parameters of this configurable class instance, or null if the class does not need any parameters. |
static List<String> |
getDateRangeSpan(long startDate,
long endDate)
Generates a list of date terms for the optimized date range search with "daily" granularity level. |
org.apache.lucene.document.Document |
getDocument(String rootPath)
Returns the Lucene document with the given root path from the index. |
I_CmsDocumentFactory |
getDocumentFactory(CmsResource res)
Returns the document type factory used for the given resource in this index, or null
in case the resource is not indexed by this index. |
CmsSearchFieldConfiguration |
getFieldConfiguration()
Returns the search field configuration of this index. |
String |
getFieldConfigurationName()
Returns the name of the field configuration used for this index. |
I_CmsIndexWriter |
getIndexWriter(I_CmsReport report,
boolean create)
Returns a new index writer for this index. |
Locale |
getLocale()
Returns the language locale of this index. |
Locale |
getLocaleForResource(CmsObject cms,
CmsResource resource,
List<Locale> availableLocales)
Returns the language locale for the given resource in this index. |
String |
getLocaleString()
Returns the language locale of the index as a String. |
int |
getMaxHits()
Indicates the number of how many hits are loaded at maximum. |
protected org.apache.lucene.search.Filter |
getMultiTermQueryFilter(String field,
List<String> terms)
Returns a cached Lucene term query filter for the given field and terms. |
protected org.apache.lucene.search.Filter |
getMultiTermQueryFilter(String field,
String terms)
Returns a cached Lucene term query filter for the given field and terms. |
protected org.apache.lucene.search.Filter |
getMultiTermQueryFilter(String field,
String termsStr,
List<String> termsList)
Returns a cached Lucene term query filter for the given field and terms. |
String |
getName()
Gets the name of this index. |
String |
getPath()
Returns the path where this index stores it's data in the "real" file system. |
int |
getPriority()
Returns the Thread priority for this search index. |
String |
getProject()
Gets the project of this index. |
String |
getRebuildMode()
Get the rebuild mode of this index. |
org.apache.lucene.search.IndexSearcher |
getSearcher()
Returns the Lucene index searcher used for this search index. |
List<String> |
getSourceNames()
Returns all configured sources names of this search index. |
List<CmsSearchIndexSource> |
getSources()
Returns all configured index sources of this search index. |
protected org.apache.lucene.search.Filter |
getTermQueryFilter(String field,
String term)
Returns a cached Lucene term query filter for the given field and term. |
int |
hashCode()
|
protected boolean |
hasReadPermission(CmsObject cms,
org.apache.lucene.document.Document doc)
Checks if the OpenCms resource referenced by the result document can be read be the user of the given OpenCms context. |
protected void |
indexSearcherClose()
Closes the Lucene index searcher for this index. |
protected void |
indexSearcherClose(org.apache.lucene.search.IndexSearcher searcher)
Closes the given Lucene index searcher. |
protected void |
indexSearcherOpen(String path)
Initializes the Lucene index searcher for this index. |
protected void |
indexSearcherUpdate()
Reopens the Lucene index search reader for this index, required after the index has been changed. |
protected I_CmsIndexWriter |
indexWriterCreate(boolean create)
Creates a new index writer. |
protected void |
indexWriterUnlock(I_CmsReport report)
Unlocks the Lucene index writer of this index if required. |
void |
initConfiguration()
Initializes a configuration after all parameters have been added. |
void |
initialize()
Initializes the search index. |
boolean |
isBackupReindexing()
Returns true if backup re-indexing is done by this index. |
boolean |
isCheckingPermissions()
Returns true if permissions are checked for search results by this index. |
boolean |
isCheckingTimeRange()
Returns true if the document time range is checked with a granularity level of seconds
for search results by this index. |
boolean |
isCreatingExcerpt()
Returns true if an excerpt is generated by this index. |
boolean |
isEnabled()
Returns true if this index is currently disabled. |
boolean |
isExtractingContent()
Returns true if full text is extracted by this index. |
protected boolean |
isInTimeRange(org.apache.lucene.document.Document doc,
CmsSearchParameters params)
Checks if the document is in the time range specified in the search parameters. |
boolean |
isRequireViewPermission()
Returns true if a resource requires read permission to be incuded in the result list. |
protected void |
prepareSortScoring(org.apache.lucene.search.IndexSearcher searcher,
org.apache.lucene.search.Sort sort)
Checks if the score for the results must be calculated based on the provided sort option. |
protected void |
removeIndexBackup(String path)
Removes the given backup folder of this index. |
void |
removeSourceName(String sourceName)
Removes an index source from this search index. |
CmsSearchResultList |
search(CmsObject cms,
CmsSearchParameters params)
Performs a search on the index within the given fields. |
void |
setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Sets the Lucene analyzer used for this index. |
void |
setEnabled(boolean enabled)
Can be used to enable / disable this index. |
void |
setFieldConfiguration(CmsSearchFieldConfiguration fieldConfiguration)
Sets the field configuration used for this index. |
void |
setFieldConfigurationName(String fieldConfigurationName)
Sets the name of the field configuration used for this index. |
void |
setLocale(Locale locale)
Sets the locale to index resources. |
void |
setLocaleString(String locale)
Sets the locale to index resources as a String. |
void |
setMaxHits(int maxHits)
Sets the number of how many hits are loaded at maximum. |
void |
setName(String name)
Sets the logical key/name of this search index. |
void |
setProject(String projectName)
Sets the name of the project used to index resources. |
void |
setProjectName(String projectName)
Sets the name of the project used to index resources. |
void |
setRebuildMode(String rebuildMode)
Sets the rebuild mode of this search index. |
void |
setRequireViewPermission(boolean requireViewPermission)
Controls if a resource requires view permission to be displayed in the result list. |
void |
shutDown()
Shuts down the search index. |
String |
toString()
Returns the name ( ) of this search index. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String BACKUP_REINDEXING
public static final String[] DATES
public static final String[] DOC_META_FIELDS
public static final String EXCERPT
public static final String EXTRACT_CONTENT
public static final String LUCENE_AUTO_COMMIT
public static final String LUCENE_MAX_MERGE_DOCS
public static final String LUCENE_MERGE_FACTOR
public static final String LUCENE_RAM_BUFFER_SIZE_MB
public static final String LUCENE_USE_COMPOUND_FILE
public static final org.apache.lucene.util.Version LUCENE_VERSION
public static final String MAX_HITS
public static final int MAX_HITS_DEFAULT
public static final int MAX_YEAR_RANGE
public static final String PERMISSIONS
public static final String PRIORITY
public static final String PROPERTY_SEARCH_EXCLUDE_VALUE_ALL
public static final String PROPERTY_SEARCH_EXCLUDE_VALUE_GALLERY
public static final String REBUILD_MODE_AUTO
public static final String REBUILD_MODE_MANUAL
public static final String REBUILD_MODE_OFFLINE
public static final String TIME_RANGE
public static final String USE_ALL_LOCALE
protected static final org.apache.lucene.document.FieldSelector CONTENT_SELECTOR
CmsSearchField.FIELD_CONTENT
and CmsSearchField.FIELD_CONTENT_BLOB
are lazy loaded.This is to optimize performance - these 2 fields will be rather large especially for extracted binary documents like PDF, MS Office etc. By using lazy fields the data is only read when it is actually used.
protected boolean m_requireViewPermission
protected List<CmsSearchIndexSource> m_sources
Constructor Detail |
---|
public CmsSearchIndex()
It is recommended to use the constructor
as it enforces the mandatory name argument. CmsSearchIndex(String)
public CmsSearchIndex(String name) throws CmsIllegalArgumentException
name
- the system-wide unique name for the search index
CmsIllegalArgumentException
- if the given name is null, empty or already taken by another search indexMethod Detail |
---|
public static List<String> getDateRangeSpan(long startDate, long endDate)
How this works:
startDate
- start date of the range to search inendDate
- end date of the range to search in
public void addConfigurationParameter(String key, String value)
addConfigurationParameter
in interface I_CmsConfigurationParameterHandler
key
- the key/name of the parametervalue
- the value of the parameterpublic void addSourceName(String sourceName)
sourceName
- the index source name to addpublic boolean checkConfiguration(CmsObject cms)
In case the check fails, the enabled
property
is set to false
cms
- a OpenCms user context to perform the checks with (should have "Administrator" permissions)
true
in case the index is correctly configured and enabled after the checkisEnabled()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public org.apache.lucene.analysis.Analyzer getAnalyzer()
public CmsParameterConfiguration getConfiguration()
I_CmsConfigurationParameterHandler
null
if the class does not need any parameters.
getConfiguration
in interface I_CmsConfigurationParameterHandler
null
if the class does not need any parametersI_CmsConfigurationParameterHandler.getConfiguration()
public org.apache.lucene.document.Document getDocument(String rootPath)
rootPath
- the root path of the document to get
public I_CmsDocumentFactory getDocumentFactory(CmsResource res)
null
in case the resource is not indexed by this index.A resource is indexed if the following is all true:
res
- the resource to check
null
in case the resource is not indexed by this indexpublic CmsSearchFieldConfiguration getFieldConfiguration()
public String getFieldConfigurationName()
public I_CmsIndexWriter getIndexWriter(I_CmsReport report, boolean create) throws CmsIndexException
report
- the report to write error messages oncreate
- if true
a whole new index is created, if false
an existing index is updated
CmsIndexException
- if the index can not be openedpublic Locale getLocale()
public Locale getLocaleForResource(CmsObject cms, CmsResource resource, List<Locale> availableLocales)
cms
- the current OpenCms user contextresource
- the resource to checkavailableLocales
- a list of locales supported by the resource
public String getLocaleString()
getLocale()
public int getMaxHits()
Since Lucene 2.4, the number of maximum documents to load from the index
must be specified. The default of this setting is MAX_HITS_DEFAULT
(5000).
This means that at maximum 5000 results are returned from the index.
Please note that this number may be reduced further because of OpenCms read permissions
or per-user file visibility settings not controlled in the index.
public String getName()
public String getPath()
public int getPriority()
public String getProject()
public String getRebuildMode()
public org.apache.lucene.search.IndexSearcher getSearcher()
public List<String> getSourceNames()
public List<CmsSearchIndexSource> getSources()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void initConfiguration()
I_CmsConfigurationParameterHandler
initConfiguration
in interface I_CmsConfigurationParameterHandler
I_CmsConfigurationParameterHandler.initConfiguration()
public void initialize() throws CmsSearchException
CmsSearchException
- if the index source association failedpublic boolean isBackupReindexing()
true
if backup re-indexing is done by this index.This is an optimization method by which the old extracted content is reused in order to save performance when re-indexing.
true
if backup re-indexing is done by this indexpublic boolean isCheckingPermissions()
true
if permissions are checked for search results by this index.
If permission checks are not required, they can be turned off in the index search configuration parameters
in opencms-search.xml
. Not checking permissions will improve performance.
This is can be of use in scenarios when you know that all search results are always readable, which is usually true for public websites that do not have personalized accounts.
Please note that even if a result is returned where the current user has no read permissions, the user can not actually access this document. It will only appear in the search result list, but if the user clicks the link to open the document he will get an error.
true
if permissions are checked for search results by this indexpublic boolean isCheckingTimeRange()
true
if the document time range is checked with a granularity level of seconds
for search results by this index.
Since OpenCms 8.0, time range checks are always done if CmsSearchParameters.setMinDateLastModified(long)
or any of the corresponding methods are used.
This is done very efficiently using optimized Lucene filers.
However, the granularity of these checks are done only on a daily
basis, which means that you can only find "changes made yesterday" but not "changes made last hour".
For normal limitation of search results, a daily granularity should be enough.
If time range checks with a granularity level of seconds are required,
they can be turned on in the index search configuration parameters
in opencms-search.xml
.
Not checking the time range with a granularity level of seconds will improve performance.
By default the granularity level of seconds is turned off since OpenCms 8.0
true
if the document time range is checked with a granularity level of seconds for search results by this indexpublic boolean isCreatingExcerpt()
true
if an excerpt is generated by this index.
If no except is required, generation can be turned off in the index search configuration parameters
in opencms-search.xml
. Not generating an excerpt will improve performance.
true
if an excerpt is generated by this indexpublic boolean isEnabled()
true
if this index is currently disabled.
true
if this index is currently disabledpublic boolean isExtractingContent()
true
if full text is extracted by this index.
Full text content extraction can be turned off in the index search configuration parameters
in opencms-search.xml
.
Not extraction the full text information will highly improve performance.
true
if full text is extracted by this indexpublic boolean isRequireViewPermission()
true
if a resource requires read permission to be incuded in the result list.
true
if a resource requires read permission to be incuded in the result listpublic void removeSourceName(String sourceName)
sourceName
- the index source name to removepublic CmsSearchResultList search(CmsObject cms, CmsSearchParameters params) throws CmsSearchException
The result is returned as List with entries of type I_CmsSearchResult.
cms
- the current user's Cms objectparams
- the parameters to use for the search
CmsSearchException
- if something goes wrongpublic void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
analyzer
- the Lucene analyzer to setpublic void setEnabled(boolean enabled)
enabled
- the state of the index to setpublic void setFieldConfiguration(CmsSearchFieldConfiguration fieldConfiguration)
fieldConfiguration
- the field configuration to setpublic void setFieldConfigurationName(String fieldConfigurationName)
fieldConfigurationName
- the name of the field configuration to setpublic void setLocale(Locale locale)
locale
- the locale to index resourcespublic void setLocaleString(String locale)
locale
- the locale to index resourcessetLocale(Locale)
public void setMaxHits(int maxHits)
This must be set at least to 50, or this setting is ignored.
maxHits
- the number of how many hits are loaded at maximum to setgetMaxHits()
public void setName(String name) throws CmsIllegalArgumentException
name
- the logical key/name of this search index
CmsIllegalArgumentException
- if the given name is null, empty or already taken by another search indexpublic void setProject(String projectName)
A duplicate method of
that allows
to use instances of this class as a widget object (bean convention,
cp.: setProjectName(String)
.getProject()
projectName
- the name of the project used to index resourcespublic void setProjectName(String projectName)
projectName
- the name of the project used to index resourcespublic void setRebuildMode(String rebuildMode)
rebuildMode
- the rebuild mode of this search index {auto|manual}public void setRequireViewPermission(boolean requireViewPermission)
By default this is false
.
requireViewPermission
- controls if a resource requires view permission to be displayed in the result listpublic void shutDown()
This will close the local Lucene index searcher instance.
public String toString()
getName()
) of this search index.
toString
in class Object
getName()
) of this search indexObject.toString()
protected org.apache.lucene.search.BooleanFilter appendCategoryFilter(CmsObject cms, org.apache.lucene.search.BooleanFilter filter, List<String> categories)
In case the provided List is null or empty, the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
cms
- the current OpenCms search contextfilter
- the filter to extendcategories
- the categories that will compose the filter
protected org.apache.lucene.search.BooleanFilter appendDateCreatedFilter(org.apache.lucene.search.BooleanFilter filter, long startTime, long endTime)
If the start time is equal to Long.MIN_VALUE
and the end time is equal to Long.MAX_VALUE
than the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
filter
- the filter to extendstartTime
- start time of the range to search inendTime
- end time of the range to search in
protected org.apache.lucene.search.BooleanFilter appendDateLastModifiedFilter(org.apache.lucene.search.BooleanFilter filter, long startTime, long endTime)
If the start time is equal to Long.MIN_VALUE
and the end time is equal to Long.MAX_VALUE
than the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
filter
- the filter to extendstartTime
- start time of the range to search inendTime
- end time of the range to search in
protected org.apache.lucene.search.BooleanFilter appendPathFilter(CmsObject cms, org.apache.lucene.search.BooleanFilter filter, List<String> roots)
In case the provided List is null or empty, the current request context site root is appended.
The original filter parameter is extended and also provided as return value.
cms
- the current OpenCms search contextfilter
- the filter to extendroots
- the VFS root paths that will compose the filter
protected org.apache.lucene.search.BooleanFilter appendResourceTypeFilter(CmsObject cms, org.apache.lucene.search.BooleanFilter filter, List<String> resourceTypes)
In case the provided List is null or empty, the original filter is left unchanged.
The original filter parameter is extended and also provided as return value.
cms
- the current OpenCms search contextfilter
- the filter to extendresourceTypes
- the resource types that will compose the filter
protected org.apache.lucene.search.Filter createDateRangeFilter(String fieldName, long startTime, long endTime)
If the start date is equal to Long.MIN_VALUE
and the end date is equal to Long.MAX_VALUE
than null
is returned.
fieldName
- the name of the field to searchstartTime
- start time of the range to search inendTime
- end time of the range to search in
protected String createIndexBackup()
null
in case no backup was createdprotected boolean excludeFromIndex(CmsObject cms, CmsResource resource)
cms
- the OpenCms context used for building the search indexresource
- the resource to index
protected void extendPathFilter(org.apache.lucene.search.TermsFilter pathFilter, String searchRoot)
pathFilter
- the path filter to extendsearchRoot
- the search root to add to the path queryprotected org.apache.lucene.search.Filter getMultiTermQueryFilter(String field, List<String> terms)
field
- the field to useterms
- the term to use
protected org.apache.lucene.search.Filter getMultiTermQueryFilter(String field, String terms)
field
- the field to useterms
- the term to use
protected org.apache.lucene.search.Filter getMultiTermQueryFilter(String field, String termsStr, List<String> termsList)
field
- the field to usetermsStr
- the terms to use as a String separated by a space ' ' chartermsList
- the list of terms to use
protected org.apache.lucene.search.Filter getTermQueryFilter(String field, String term)
field
- the field to useterm
- the term to use
protected boolean hasReadPermission(CmsObject cms, org.apache.lucene.document.Document doc)
cms
- the OpenCms user context to use for permission testingdoc
- the search result document to check
true
if the user has read permissions to the resourceprotected void indexSearcherClose()
indexSearcherOpen(String)
protected void indexSearcherClose(org.apache.lucene.search.IndexSearcher searcher)
searcher
- the searcher to closeprotected void indexSearcherOpen(String path)
Use getSearcher()
in order to obtain the searcher that has been opened.
In case there is an index searcher still open, it is closed first.
For performance reasons, one instance of the Lucene index searcher should be kept for all searches. However, if the index is updated or changed this searcher instance needs to be re-initialized.
path
- the path to the index directoryprotected void indexSearcherUpdate()
indexSearcherOpen(String)
protected I_CmsIndexWriter indexWriterCreate(boolean create) throws CmsIndexException
create
- if true
a whole new index is created, if false
an existing index is updated
CmsIndexException
- in case the writer could not be createdgetIndexWriter(I_CmsReport, boolean)
protected void indexWriterUnlock(I_CmsReport report) throws CmsIndexException
report
- the report to write error messages on
CmsIndexException
- if unlocking of the index is impossible for any reasonprotected boolean isInTimeRange(org.apache.lucene.document.Document doc, CmsSearchParameters params)
The creation date and/or the last modification date are checked.
doc
- the document to check the dates against the given time rangeparams
- the search parameters where the time ranges are specified
protected void prepareSortScoring(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.Sort sort)
Since Lucene 3 apparently the score is no longer calculated by default, but only if the searcher is explicitly told so. This methods checks if, based on the given sort, the score must be calculated.
searcher
- the index searcher to preparesort
- the sort option to useprotected void removeIndexBackup(String path)
path
- the backup folder to removeisBackupReindexing()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |