public class SearchIndex extends AbstractQueryHandler
QueryHandler
using
Lucene.Modifier and Type | Class and Description |
---|---|
protected static class |
SearchIndex.CombinedIndexReader
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EXTRACTOR_BACK_LOG
The default value for property
extractorBackLog . |
static int |
DEFAULT_EXTRACTOR_POOL_SIZE
Deprecated.
this value is not used anymore. Instead the default value
is calculated as follows: 2 * Runtime.getRuntime().availableProcessors().
|
static long |
DEFAULT_EXTRACTOR_TIMEOUT
The default timeout in milliseconds which is granted to the text
extraction process until fulltext indexing is deferred to a background
thread.
|
static int |
DEFAULT_MAX_FIELD_LENGTH
the default value for property
maxFieldLength . |
static int |
DEFAULT_MAX_MERGE_DOCS
The default value for property
maxMergeDocs . |
static int |
DEFAULT_MERGE_FACTOR
the default value for property
mergeFactor . |
static int |
DEFAULT_MIN_MERGE_DOCS
The default value for property
minMergeDocs . |
static int |
DEFAULT_TERM_INFOS_INDEX_DIVISOR
The default value for
termInfosIndexDivisor . |
protected MultiIndex |
index
The actual index
|
protected static Path |
JCR_SYSTEM_PATH
The path
/jcr:system . |
protected static PathFactory |
PATH_FACTORY
The path factory.
|
protected static Path |
ROOT_PATH
The path of the root node.
|
static Collection<Name> |
VALID_SYSTEM_INDEX_NODE_TYPE_NAMES
Valid node type names under /jcr:system.
|
fs
Constructor and Description |
---|
SearchIndex() |
Modifier and Type | Method and Description |
---|---|
void |
addNode(NodeState node)
Adds the
node to the search index. |
protected void |
checkOpen()
Checks if this
SearchIndex is open, otherwise throws
an IOException . |
void |
close()
Closes this
QueryHandler and frees resources attached
to this handler. |
protected DirectoryManager |
createDirectoryManager() |
protected org.apache.lucene.document.Document |
createDocument(NodeState node,
NamespaceMappings nsMappings,
IndexFormatVersion indexFormatVersion)
Creates a lucene
Document for a node state using the
namespace mappings nsMappings . |
ExcerptProvider |
createExcerptProvider(org.apache.lucene.search.Query query)
Creates an excerpt provider for the given
query . |
ExecutableQuery |
createExecutableQuery(SessionContext sessionContext,
String statement,
String language)
Creates a new query by specifying the query statement itself and the
language in which the query is stated.
|
protected IndexingConfiguration |
createIndexingConfiguration(NamespaceMappings namespaceMappings) |
protected Ordering[] |
createOrderings(OrderingImpl[] orderings)
Creates internal orderings for the QOM ordering specifications.
|
protected RedoLogFactory |
createRedoLogFactory()
Creates a redo log factory based on
getRedoLogFactoryClass() . |
protected org.apache.lucene.search.SortField[] |
createSortFields(Path[] orderProps,
boolean[] orderSpecs,
String[] orderFuncs)
Creates the SortFields for the order properties.
|
protected SpellChecker |
createSpellChecker()
Creates a spell checker for this query handler.
|
protected SynonymProvider |
createSynonymProvider() |
protected FileSystemResource |
createSynonymProviderConfigResource()
Creates a file system resource to the synonym provider configuration.
|
void |
deleteNode(NodeId id)
Removes the node with
id from the search index. |
protected void |
doInit()
Initializes this
QueryHandler . |
MultiColumnQueryHits |
executeQuery(SessionImpl session,
AbstractQueryImpl queryImpl,
org.apache.lucene.search.Query query,
Path[] orderProps,
boolean[] orderSpecs,
String[] orderFuncs,
long resultFetchHint)
Executes the query on the search index.
|
MultiColumnQueryHits |
executeQuery(SessionImpl session,
MultiColumnQuery query,
Ordering[] orderings,
long resultFetchHint)
Executes the query on the search index.
|
void |
flush()
Waits until all pending text extraction tasks have been processed
and the updated index has been flushed to disk.
|
String |
getAnalyzer()
Returns the class name of the default analyzer that is currently in use.
|
boolean |
getAutoRepair() |
int |
getBufferSize()
Returns the current value for the buffer size.
|
int |
getCacheSize() |
DirectoryManager |
getDirectoryManager() |
String |
getDirectoryManagerClass() |
boolean |
getEnableConsistencyCheck() |
String |
getExcerptProviderClass() |
int |
getExtractorBackLogSize() |
int |
getExtractorPoolSize() |
long |
getExtractorTimeout() |
boolean |
getForceConsistencyCheck() |
String |
getForkJavaCommand()
Returns the java command used to fork external parser processes,
or
null (the default) for in-process text extraction. |
protected MultiIndex |
getIndex()
Returns the actual index.
|
IndexFormatVersion |
getIndexFormatVersion()
Returns the index format version that this search index is able to
support when a query is executed on this index.
|
IndexingConfiguration |
getIndexingConfig() |
String |
getIndexingConfiguration() |
String |
getIndexingConfigurationClass() |
protected Element |
getIndexingConfigurationDOM()
Returns the document element of the indexing configuration or
null if there is no indexing configuration. |
org.apache.lucene.index.IndexReader |
getIndexReader()
Returns an index reader for this search index.
|
protected org.apache.lucene.index.IndexReader |
getIndexReader(boolean includeSystemIndex)
Returns an index reader for this search index.
|
int |
getMaxExtractLength() |
int |
getMaxFieldLength() |
long |
getMaxHistoryAge() |
int |
getMaxMergeDocs()
Returns the current value for maxMergeDocs.
|
long |
getMaxVolatileIndexSize() |
int |
getMergeFactor()
Returns the current value for the merge factor.
|
int |
getMinMergeDocs()
Returns the current value for minMergeDocs.
|
NamespaceMappings |
getNamespaceMappings()
Returns the namespace mappings for the internal representation.
|
org.apache.tika.parser.Parser |
getParser()
Returns the parser used for extracting text content
from binary properties for full text indexing.
|
String |
getPath()
Returns the location of the search index.
|
protected DefaultQueryNodeFactory |
getQueryNodeFactory()
This method returns the QueryNodeFactory used to parse Queries.
|
RedoLogFactory |
getRedoLogFactory() |
String |
getRedoLogFactoryClass() |
protected Path |
getRelativePath(NodeState nodeState,
PropertyState propState)
Returns the relative path from
nodeState to
propState . |
boolean |
getRespectDocumentOrder() |
int |
getResultFetchSize() |
org.apache.lucene.search.Similarity |
getSimilarity() |
String |
getSimilarityClass() |
boolean |
getSizeEstimate()
Get the size estimate setting.
|
protected SharedFieldComparatorSource |
getSortComparatorSource() |
SpellChecker |
getSpellChecker() |
String |
getSpellCheckerClass() |
boolean |
getSupportHighlighting() |
SynonymProvider |
getSynonymProvider() |
String |
getSynonymProviderClass() |
String |
getSynonymProviderConfigPath() |
int |
getTermInfosIndexDivisor() |
org.apache.lucene.analysis.Analyzer |
getTextAnalyzer()
Returns the analyzer in use for indexing.
|
String |
getTextFilterClasses()
Deprecated.
|
String |
getTikaConfigPath()
Returns the path of the Tika configuration used for text extraction.
|
boolean |
getUseCompoundFile()
Returns the current value for useCompoundFile.
|
int |
getVolatileIdleTime()
Returns the current value for volatileIdleTime.
|
Iterable<NodeId> |
getWeaklyReferringNodes(NodeId id)
Returns the ids of the nodes that refer to the node with
id
by weak references. |
boolean |
isInitializeHierarchyCache() |
boolean |
isUseSimpleFSDirectory() |
protected void |
mergeAggregatedNodeIndexes(NodeState state,
org.apache.lucene.document.Document doc,
IndexFormatVersion ifv)
Merges the fulltext indexed fields of the aggregated node states into
doc . |
protected void |
retrieveAggregateRoot(NodeState state,
Map<NodeId,NodeState> aggregates)
Retrieves the root of the indexing aggregate for
state and
puts it into aggregates map. |
protected void |
retrieveAggregateRoot(Set<NodeId> removedIds,
Map<NodeId,NodeState> aggregates)
Retrieves the root of the indexing aggregate for
removedIds
and puts it into map . |
ConsistencyCheck |
runConsistencyCheck()
Runs a consistency check on this search index.
|
void |
setAnalyzer(String analyzerClassName)
Sets the default analyzer in use for indexing.
|
void |
setAutoRepair(boolean b) |
void |
setBufferSize(int size) |
void |
setCacheSize(int size) |
void |
setDirectoryManagerClass(String className)
Sets name of the directory manager class.
|
void |
setEnableConsistencyCheck(boolean b)
Enables or disables the consistency check on startup.
|
void |
setExcerptProviderClass(String className)
Sets the class name for the
ExcerptProvider that should be used
for the rep:excerpt pseudo property in a query. |
void |
setExtractorBackLogSize(int backLog)
The number of extractor jobs that are queued until a new job is executed
with the current thread instead of using the thread pool.
|
void |
setExtractorPoolSize(int numThreads)
The number of background threads for the extractor pool.
|
void |
setExtractorTimeout(long timeout)
The timeout in milliseconds which is granted to the text extraction
process until fulltext indexing is deferred to a background thread.
|
void |
setForceConsistencyCheck(boolean b) |
void |
setForkJavaCommand(String command)
Sets the java command used to fork external parser processes.
|
void |
setIndexingConfiguration(String path)
Sets the path to the indexing configuration file.
|
void |
setIndexingConfigurationClass(String className)
Sets the name of the class that implements
IndexingConfiguration . |
void |
setInitializeHierarchyCache(boolean initializeHierarchyCache)
Whether the hierarchy cache should be initialized immediately on
startup.
|
void |
setMaxExtractLength(int length) |
void |
setMaxFieldLength(int length) |
void |
setMaxHistoryAge(long maxHistoryAge)
Sets a new value for the maximum age in seconds for outdated generations
of
IndexInfos . |
void |
setMaxMergeDocs(int maxMergeDocs)
The lucene index writer property: maxMergeDocs
|
void |
setMaxVolatileIndexSize(long maxVolatileIndexSize)
Sets a new maxVolatileIndexSize value.
|
void |
setMergeFactor(int mergeFactor)
The lucene index writer property: mergeFactor
|
void |
setMinMergeDocs(int minMergeDocs)
The lucene index writer property: minMergeDocs
|
void |
setPath(String path)
Sets the location of the search index.
|
void |
setRedoLogFactoryClass(String className)
Sets the name of the redo log factory class.
|
void |
setRespectDocumentOrder(boolean docOrder) |
void |
setResultFetchSize(int size)
Tells the query handler how many result should be fetched initially when
a query is executed.
|
void |
setSimilarityClass(String className)
Sets the similarity implementation, which will be used for indexing and
searching.
|
void |
setSizeEstimate(boolean b)
If enabled, NodeIterator.getSize() may report a larger value than the
actual result.
|
void |
setSpellCheckerClass(String className)
Sets the name of the class that implements
SpellChecker . |
void |
setSupportHighlighting(boolean b)
If set to
true additional information is stored in the index
to support highlighting using the rep:excerpt pseudo property. |
void |
setSynonymProviderClass(String className)
Sets the name of the class that implements
SynonymProvider . |
void |
setSynonymProviderConfigPath(String path)
Sets the configuration path for the synonym provider.
|
void |
setTermInfosIndexDivisor(int termInfosIndexDivisor)
Sets a new value for termInfosIndexDivisor.
|
void |
setTextFilterClasses(String filterClasses)
Deprecated.
|
void |
setTikaConfigPath(String tikaConfigPath)
Sets the path of the Tika configuration used for text extraction.
|
void |
setUseCompoundFile(boolean b)
The lucene index writer property: useCompoundFile
|
void |
setUseSimpleFSDirectory(boolean useSimpleFSDirectory)
|
void |
setVolatileIdleTime(int volatileIdleTime)
Sets the property: volatileIdleTime
|
void |
updateNodes(Iterator<NodeId> remove,
Iterator<NodeState> add)
This implementation forwards the call to
MultiIndex.update(Collection, Collection) and
transforms the two iterators to the required types. |
getContext, getIdleTime, getOnWorkspaceInconsistency, getOnWorkspaceInconsistencyHandler, getQueryClass, init, setIdleTime, setOnWorkspaceInconsistency, setQueryClass
public static final Collection<Name> VALID_SYSTEM_INDEX_NODE_TYPE_NAMES
public static final int DEFAULT_MIN_MERGE_DOCS
minMergeDocs
.public static final int DEFAULT_MAX_MERGE_DOCS
maxMergeDocs
.public static final int DEFAULT_MERGE_FACTOR
mergeFactor
.public static final int DEFAULT_MAX_FIELD_LENGTH
maxFieldLength
.public static final int DEFAULT_EXTRACTOR_POOL_SIZE
extractorPoolSize
.public static final int DEFAULT_EXTRACTOR_BACK_LOG
extractorBackLog
.public static final long DEFAULT_EXTRACTOR_TIMEOUT
public static final int DEFAULT_TERM_INFOS_INDEX_DIVISOR
termInfosIndexDivisor
.protected static final PathFactory PATH_FACTORY
protected static final Path ROOT_PATH
protected static final Path JCR_SYSTEM_PATH
/jcr:system
.protected MultiIndex index
protected void doInit() throws IOException
QueryHandler
. This implementation requires
that a path parameter is set in the configuration. If this condition
is not met, a IOException
is thrown.doInit
in class AbstractQueryHandler
IOException
- if an error occurs while initializing this handler.public void addNode(NodeState node) throws javax.jcr.RepositoryException, IOException
node
to the search index.node
- the node to add.javax.jcr.RepositoryException
- if an error occurs while indexing the node.IOException
- if an error occurs while adding the node to the index.public void deleteNode(NodeId id) throws IOException
id
from the search index.id
- the id of the node to remove from the index.IOException
- if an error occurs while removing the node from
the index.public void updateNodes(Iterator<NodeId> remove, Iterator<NodeState> add) throws javax.jcr.RepositoryException, IOException
MultiIndex.update(Collection, Collection)
and
transforms the two iterators to the required types.updateNodes
in interface QueryHandler
updateNodes
in class AbstractQueryHandler
remove
- ids of nodes to remove.add
- NodeStates to add. Calls to next()
on this
iterator may return null
, to indicate that a
node could not be indexed successfully.javax.jcr.RepositoryException
- if an error occurs while indexing a node.IOException
- if an error occurs while updating the index.public ExecutableQuery createExecutableQuery(SessionContext sessionContext, String statement, String language) throws javax.jcr.query.InvalidQueryException
language
must specify a query language
string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not
then an InvalidQueryException
is thrown.sessionContext
- component context of the current sessionstatement
- the query statement.language
- the syntax of the query statement.Query
object.javax.jcr.query.InvalidQueryException
- if statement is invalid or language is unsupported.public Iterable<NodeId> getWeaklyReferringNodes(NodeId id) throws javax.jcr.RepositoryException, IOException
id
by weak references.id
- the id of the target node.javax.jcr.RepositoryException
- if an error occurs.IOException
- if an error occurs while reading from the
index.protected DefaultQueryNodeFactory getQueryNodeFactory()
public void flush() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the index update can not be writtenpublic void close() throws IOException
QueryHandler
and frees resources attached
to this handler.close
in interface QueryHandler
close
in class AbstractQueryHandler
IOException
public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, org.apache.lucene.search.Query query, Path[] orderProps, boolean[] orderSpecs, String[] orderFuncs, long resultFetchHint) throws IOException
session
- the session that executes the query.queryImpl
- the query impl.query
- the lucene query.orderProps
- name of the properties for sort order.orderSpecs
- the order specs for the sort order properties.
true
indicates ascending order,
false
indicates descending.orderFuncs
- functions for the properties for sort order.resultFetchHint
- a hint on how many results should be fetched. @return the query hits.IOException
- if an error occurs while searching the index.public MultiColumnQueryHits executeQuery(SessionImpl session, MultiColumnQuery query, Ordering[] orderings, long resultFetchHint) throws IOException
session
- the session that executes the query.query
- the query.orderings
- the order specs for the sort order.resultFetchHint
- a hint on how many results should be fetched.IOException
- if an error occurs while searching the index.public ExcerptProvider createExcerptProvider(org.apache.lucene.search.Query query) throws IOException
query
.query
- the query.query
.IOException
- if the provider cannot be created.public org.apache.lucene.analysis.Analyzer getTextAnalyzer()
public String getTikaConfigPath()
public void setTikaConfigPath(String tikaConfigPath)
tikaConfigPath
- path of the Tika configuration filepublic String getForkJavaCommand()
null
(the default) for in-process text extraction.public void setForkJavaCommand(String command)
command
- fork java command,
or null
for in-process extractionpublic org.apache.tika.parser.Parser getParser()
public NamespaceMappings getNamespaceMappings()
public IndexingConfiguration getIndexingConfig()
null
if there is
none.public SynonymProvider getSynonymProvider()
public SpellChecker getSpellChecker()
null
.public org.apache.lucene.search.Similarity getSimilarity()
public org.apache.lucene.index.IndexReader getIndexReader() throws IOException
IOException
- the index reader cannot be obtained.public IndexFormatVersion getIndexFormatVersion()
public DirectoryManager getDirectoryManager()
public RedoLogFactory getRedoLogFactory()
public ConsistencyCheck runConsistencyCheck() throws IOException
IOException
- if an error occurs while running the check.protected org.apache.lucene.index.IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
includeSystemIndex
- if true
the index reader will
cover the complete workspace. If
false
the returned index reader
will not contains any nodes under /jcr:system.IOException
- the index reader cannot be obtained.protected org.apache.lucene.search.SortField[] createSortFields(Path[] orderProps, boolean[] orderSpecs, String[] orderFuncs)
orderProps
- the order properties.orderSpecs
- the order specs for the properties.orderFuncs
- the functions for the properties.protected Ordering[] createOrderings(OrderingImpl[] orderings) throws javax.jcr.RepositoryException
orderings
- the QOM ordering specifications.javax.jcr.RepositoryException
- if an error occurs.protected org.apache.lucene.document.Document createDocument(NodeState node, NamespaceMappings nsMappings, IndexFormatVersion indexFormatVersion) throws javax.jcr.RepositoryException
Document
for a node state using the
namespace mappings nsMappings
.node
- the node state to index.nsMappings
- the namespace mappings of the search index.indexFormatVersion
- the index format version that should be used to
index the passed node state.Document
that contains all properties of
node
.javax.jcr.RepositoryException
- if an error occurs while indexing the
node
.protected MultiIndex getIndex()
protected SharedFieldComparatorSource getSortComparatorSource()
protected IndexingConfiguration createIndexingConfiguration(NamespaceMappings namespaceMappings)
namespaceMappings
- The namespace mappingsnull
if there
is no configuration.protected SynonymProvider createSynonymProvider()
null
if none is
configured or an error occurs.protected DirectoryManager createDirectoryManager() throws IOException
DirectoryManager
.IOException
- if the directory manager cannot be instantiated or
an exception occurs while initializing the manager.protected RedoLogFactory createRedoLogFactory() throws IOException
getRedoLogFactoryClass()
.IOException
- if an error occurs while creating the factory.protected FileSystemResource createSynonymProviderConfigResource() throws FileSystemException, IOException
null
if no path was
configured.FileSystemException
- if an exception occurs accessing the file
system.IOException
- if another exception occurs.protected SpellChecker createSpellChecker()
null
if none is configured or
an error occurs.protected Element getIndexingConfigurationDOM()
null
if there is no indexing configuration.null
if there is
none.protected void mergeAggregatedNodeIndexes(NodeState state, org.apache.lucene.document.Document doc, IndexFormatVersion ifv)
doc
.state
- the node state on which doc
was created.doc
- the lucene document with index fields from state
.ifv
- the current index format version.protected Path getRelativePath(NodeState nodeState, PropertyState propState) throws javax.jcr.RepositoryException, ItemStateException
nodeState
to
propState
.nodeState
- a node state.propState
- a property state.javax.jcr.RepositoryException
- if an error occurs while resolving paths.ItemStateException
- if an error occurs while reading item
states.protected void retrieveAggregateRoot(NodeState state, Map<NodeId,NodeState> aggregates)
state
and
puts it into aggregates
map.state
- the node state for which we want to retrieve the aggregate
root.aggregates
- aggregate roots are collected in this map.protected void retrieveAggregateRoot(Set<NodeId> removedIds, Map<NodeId,NodeState> aggregates)
removedIds
and puts it into map
.removedIds
- the ids of removed nodes.aggregates
- aggregate roots are collected in this mappublic void setAnalyzer(String analyzerClassName)
Version
argumentIf the above conditions are met, then a new instance of the class is set as the analyzer. Otherwise a warning is logged and the current analyzer is not changed.
This property setter method is normally invoked by the Jackrabbit configuration mechanism if the "analyzer" parameter is set in the search configuration.
analyzerClassName
- the analyzer class namepublic String getAnalyzer()
public void setPath(String path)
path
- the location of the search index.public String getPath()
null
if
not set.public void setUseCompoundFile(boolean b)
public boolean getUseCompoundFile()
public void setMinMergeDocs(int minMergeDocs)
public int getMinMergeDocs()
public void setVolatileIdleTime(int volatileIdleTime)
volatileIdleTime
- idle time in secondspublic int getVolatileIdleTime()
public void setMaxMergeDocs(int maxMergeDocs)
public int getMaxMergeDocs()
public void setMergeFactor(int mergeFactor)
public int getMergeFactor()
public void setBufferSize(int size)
VolatileIndex.setBufferSize(int)
public int getBufferSize()
public void setRespectDocumentOrder(boolean docOrder)
public boolean getRespectDocumentOrder()
public void setForceConsistencyCheck(boolean b)
public boolean getForceConsistencyCheck()
public void setAutoRepair(boolean b)
public boolean getAutoRepair()
public void setCacheSize(int size)
public int getCacheSize()
public void setMaxFieldLength(int length)
public int getMaxFieldLength()
public void setMaxExtractLength(int length)
public int getMaxExtractLength()
public void setTextFilterClasses(String filterClasses)
TextExtractor
(and org.apache.jackrabbit.core.query.TextFilter
) classes
to be used. The configured classes must all have a public default
constructor.filterClasses
- comma separated list of class namespublic String getTextFilterClasses()
public void setResultFetchSize(int size)
size
- the number of results to fetch initially.public int getResultFetchSize()
public void setExtractorPoolSize(int numThreads)
numThreads
- the number of threads.public int getExtractorPoolSize()
public void setExtractorBackLogSize(int backLog)
backLog
- size of the extractor job queue.public int getExtractorBackLogSize()
public void setExtractorTimeout(long timeout)
timeout
- the timeout in milliseconds.public long getExtractorTimeout()
public void setSizeEstimate(boolean b)
b
- true
to enablepublic boolean getSizeEstimate()
public void setSupportHighlighting(boolean b)
true
additional information is stored in the index
to support highlighting using the rep:excerpt pseudo property.b
- true
to enable highlighting support.public boolean getSupportHighlighting()
true
if highlighting support is enabled.public void setExcerptProviderClass(String className)
ExcerptProvider
that should be used
for the rep:excerpt pseudo property in a query.className
- the name of a class that implements ExcerptProvider
.public String getExcerptProviderClass()
public void setIndexingConfiguration(String path)
path
- the path to the configuration file.public String getIndexingConfiguration()
public void setIndexingConfigurationClass(String className)
IndexingConfiguration
.
The default value is org.apache.jackrabbit.core.query.lucene.IndexingConfigurationImpl
.className
- the name of the class that implements IndexingConfiguration
.public String getIndexingConfigurationClass()
public void setSynonymProviderClass(String className)
SynonymProvider
. The
default value is null
(none set).className
- name of the class that implements SynonymProvider
.public String getSynonymProviderClass()
null
if none is set.public void setSpellCheckerClass(String className)
SpellChecker
. The
default value is null
(none set).className
- name of the class that implements SpellChecker
.public String getSpellCheckerClass()
null
if none is set.public void setEnableConsistencyCheck(boolean b)
b
- true
enables consistency checks.setForceConsistencyCheck(boolean)
public boolean getEnableConsistencyCheck()
true
if consistency checks are enabled.public void setSynonymProviderConfigPath(String path)
path
- the configuration path for the synonym provider.public String getSynonymProviderConfigPath()
null
.public void setSimilarityClass(String className)
Similarity
.className
- a Similarity
implementation.public String getSimilarityClass()
public void setMaxVolatileIndexSize(long maxVolatileIndexSize)
maxVolatileIndexSize
- the new value.public long getMaxVolatileIndexSize()
public String getDirectoryManagerClass()
public void setDirectoryManagerClass(String className)
DirectoryManager
.className
- the name of the class that implements directory manager.public void setUseSimpleFSDirectory(boolean useSimpleFSDirectory)
useSimpleFSDirectory
- whether to use SimpleFSDirectory
or automatically pick an implementation based
on the current platform.public boolean isUseSimpleFSDirectory()
true
if the DirectoryManager
should use
the SimpleFSDirectory
.public int getTermInfosIndexDivisor()
public void setTermInfosIndexDivisor(int termInfosIndexDivisor)
termInfosIndexDivisor
- the new value.public boolean isInitializeHierarchyCache()
true
if the hierarchy cache should be initialized
immediately on startup.public void setInitializeHierarchyCache(boolean initializeHierarchyCache)
initializeHierarchyCache
- true
if the cache should be
initialized immediately.public long getMaxHistoryAge()
IndexInfos
.public void setMaxHistoryAge(long maxHistoryAge)
IndexInfos
.maxHistoryAge
- age in seconds.public String getRedoLogFactoryClass()
public void setRedoLogFactoryClass(String className)
RedoLogFactory
.className
- the name of the redo log factory class.protected void checkOpen() throws IOException
SearchIndex
is open, otherwise throws
an IOException
.IOException
- if this SearchIndex
had been closed.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.