Class OLuceneIndexEngineAbstract
java.lang.Object
com.orientechnologies.lucene.engine.OLuceneIndexEngineAbstract
- All Implemented Interfaces:
OLuceneIndexEngine,OBaseIndexEngine,OIndexEngine,OFreezableStorageComponent
- Direct Known Subclasses:
OLuceneFullTextIndexEngine,OLuceneSpatialIndexEngineAbstract
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OIndexDefinitionstatic final Stringprotected ODocumentprotected Stringstatic final Stringprotected org.apache.lucene.util.VersionFields inherited from interface com.orientechnologies.orient.core.index.engine.OIndexEngine
VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAcquires exclusive lock in the active atomic operation running on the current thread for this index engine.protected voidaddDocument(org.apache.lucene.document.Document doc) voidclear(OAtomicOperation atomicOperation) voidclose()voidcreate(OAtomicOperation atomicOperation, IndexEngineData data) protected abstract org.apache.lucene.index.IndexWritercreateIndexWriter(org.apache.lucene.store.Directory directory) voiddelete(OAtomicOperation atomicOperation) org.apache.lucene.search.QuerydeleteQuery(Object key, OIdentifiable value) descStream(IndexEngineValuesTransformer valuesTransformer) voidflush()voidfreeze(boolean throwException) After this method finished it's execution, all threads that are going to perform data modifications in storage should wait tillOFreezableStorageComponent.release()method will be called.protected static ODatabaseDocumentInternalintgetId()getIndexNameByKey(Object key) getName()org.apache.lucene.analysis.Analyzervoidinit(OIndexMetadata im) booleanvoidload(IndexEngineData data) abstract voidonRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, org.apache.lucene.document.Document ret, org.apache.lucene.search.ScoreDoc score) protected voidorg.apache.lucene.analysis.Analyzervoidrelease()After this method finished execution all threads that are waiting to perform data modifications in storage will be awaken and will be allowed to continue their execution.voidrelease(org.apache.lucene.search.IndexSearcher searcher) booleanbooleanremove(Object key, OIdentifiable value) org.apache.lucene.search.IndexSearchersearcher()longsize(IndexEngineValuesTransformer transformer) longsizeInTx(OLuceneTxChanges changes) stream(IndexEngineValuesTransformer valuesTransformer) protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.index.engine.OBaseIndexEngine
applyTxChanges, getUniqueIndexVersion, hasRangeQuerySupport, hasRidBagTreesSupport, iterateEntriesBetween, iterateEntriesMajor, iterateEntriesMinor, updateUniqueIndexVersionMethods inherited from interface com.orientechnologies.orient.core.index.engine.OIndexEngine
get, getEngineAPIVersion, put, put, remove, remove, update, validatedPutMethods inherited from interface com.orientechnologies.lucene.engine.OLuceneIndexEngine
buildDocument, buildQuery, getInTx
-
Field Details
-
RID
- See Also:
-
KEY
- See Also:
-
indexDefinition
-
name
-
metadata
-
version
protected org.apache.lucene.util.Version version -
collectionFields
-
-
Constructor Details
-
OLuceneIndexEngineAbstract
-
-
Method Details
-
getId
public int getId()- Specified by:
getIdin interfaceOBaseIndexEngine
-
updateLastAccess
protected void updateLastAccess() -
addDocument
protected void addDocument(org.apache.lucene.document.Document doc) -
init
- Specified by:
initin interfaceOBaseIndexEngine
-
getDatabase
-
createIndexWriter
protected abstract org.apache.lucene.index.IndexWriter createIndexWriter(org.apache.lucene.store.Directory directory) throws IOException - Throws:
IOException
-
flush
public void flush()- Specified by:
flushin interfaceOBaseIndexEngine
-
create
- Specified by:
createin interfaceOBaseIndexEngine- Throws:
IOException
-
delete
- Specified by:
deletein interfaceOBaseIndexEngine
-
indexName
- Specified by:
indexNamein interfaceOLuceneIndexEngine
-
onRecordAddedToResultSet
public abstract void onRecordAddedToResultSet(OLuceneQueryContext queryContext, OContextualRecordId recordId, org.apache.lucene.document.Document ret, org.apache.lucene.search.ScoreDoc score) - Specified by:
onRecordAddedToResultSetin interfaceOLuceneIndexEngine
-
indexAnalyzer
public org.apache.lucene.analysis.Analyzer indexAnalyzer()- Specified by:
indexAnalyzerin interfaceOLuceneIndexEngine
-
queryAnalyzer
public org.apache.lucene.analysis.Analyzer queryAnalyzer()- Specified by:
queryAnalyzerin interfaceOLuceneIndexEngine
-
remove
- Specified by:
removein interfaceOLuceneIndexEngine
-
remove
- Specified by:
removein interfaceOLuceneIndexEngine
-
openIfClosed
protected void openIfClosed() -
isCollectionIndex
public boolean isCollectionIndex()- Specified by:
isCollectionIndexin interfaceOLuceneIndexEngine
-
searcher
public org.apache.lucene.search.IndexSearcher searcher()- Specified by:
searcherin interfaceOLuceneIndexEngine
-
sizeInTx
- Specified by:
sizeInTxin interfaceOLuceneIndexEngine
-
buildTxChanges
- Specified by:
buildTxChangesin interfaceOLuceneIndexEngine- Throws:
IOException
-
deleteQuery
- Specified by:
deleteQueryin interfaceOLuceneIndexEngine
-
load
- Specified by:
loadin interfaceOBaseIndexEngine
-
clear
- Specified by:
clearin interfaceOBaseIndexEngine
-
close
public void close()- Specified by:
closein interfaceOBaseIndexEngine
-
descStream
- Specified by:
descStreamin interfaceOBaseIndexEngine
-
stream
- Specified by:
streamin interfaceOBaseIndexEngine
-
keyStream
- Specified by:
keyStreamin interfaceOBaseIndexEngine
-
size
- Specified by:
sizein interfaceOBaseIndexEngine
-
release
public void release(org.apache.lucene.search.IndexSearcher searcher) - Specified by:
releasein interfaceOLuceneIndexEngine
-
getName
- Specified by:
getNamein interfaceOBaseIndexEngine
-
acquireAtomicExclusiveLock
Description copied from interface:OBaseIndexEngineAcquires exclusive lock in the active atomic operation running on the current thread for this index engine.If this index engine supports a more narrow locking, for example key-based sharding, it may use the provided
keyto infer a more narrow lock scope, but that is not a requirement.- Specified by:
acquireAtomicExclusiveLockin interfaceOBaseIndexEngine- Parameters:
key- the index key to lock.- Returns:
trueif this index was locked entirely,falseif this index locking is sensitive to the providedkeyand only some subset of this index was locked.
-
getIndexNameByKey
- Specified by:
getIndexNameByKeyin interfaceOBaseIndexEngine
-
freeze
public void freeze(boolean throwException) Description copied from interface:OFreezableStorageComponentAfter this method finished it's execution, all threads that are going to perform data modifications in storage should wait tillOFreezableStorageComponent.release()method will be called. This method will wait till all ongoing modifications will be finished.- Specified by:
freezein interfaceOFreezableStorageComponent- Parameters:
throwException- IftrueOModificationOperationProhibitedExceptionexception will be thrown on call of methods that requires storage modification. Otherwise other threads will wait forOFreezableStorageComponent.release()method call.
-
release
public void release()Description copied from interface:OFreezableStorageComponentAfter this method finished execution all threads that are waiting to perform data modifications in storage will be awaken and will be allowed to continue their execution.- Specified by:
releasein interfaceOFreezableStorageComponent
-