Class GridLuceneIndex
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.h2.opt.GridLuceneIndex
-
- All Implemented Interfaces:
AutoCloseable
public class GridLuceneIndex extends Object implements AutoCloseable
Lucene fulltext index.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXPIRATION_TIME_FIELD_NAMEField name for value expiration time.static StringVAL_STR_FIELD_NAMEField name for string representation of value.static StringVER_FIELD_NAMEField name for value version.
-
Constructor Summary
Constructors Constructor Description GridLuceneIndex(GridKernalContext ctx, @Nullable String cacheName, GridQueryTypeDescriptor type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<K,V>
GridCloseableIterator<IgniteBiTuple<K,V>>query(String qry, IndexingQueryFilter filters, int limit)Runs lucene fulltext query over this index.voidremove(CacheObject key)Removes entry for given key from this index.voidstore(CacheObject k, CacheObject v, GridCacheVersion ver, long expires)Stores given data in this fulltext index.
-
-
-
Field Detail
-
VAL_STR_FIELD_NAME
public static final String VAL_STR_FIELD_NAME
Field name for string representation of value.- See Also:
- Constant Field Values
-
VER_FIELD_NAME
public static final String VER_FIELD_NAME
Field name for value version.- See Also:
- Constant Field Values
-
EXPIRATION_TIME_FIELD_NAME
public static final String EXPIRATION_TIME_FIELD_NAME
Field name for value expiration time.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GridLuceneIndex
public GridLuceneIndex(GridKernalContext ctx, @Nullable @Nullable String cacheName, GridQueryTypeDescriptor type) throws IgniteCheckedException
Constructor.- Parameters:
ctx- Kernal context.cacheName- Cache name.type- Type descriptor.- Throws:
IgniteCheckedException- If failed.
-
-
Method Detail
-
store
public void store(CacheObject k, CacheObject v, GridCacheVersion ver, long expires) throws IgniteCheckedException
Stores given data in this fulltext index.- Parameters:
k- Key.v- Value.ver- Version.expires- Expiration time.- Throws:
IgniteCheckedException- If failed.
-
remove
public void remove(CacheObject key) throws IgniteCheckedException
Removes entry for given key from this index.- Parameters:
key- Key.- Throws:
IgniteCheckedException- If failed.
-
query
public <K,V> GridCloseableIterator<IgniteBiTuple<K,V>> query(String qry, IndexingQueryFilter filters, int limit) throws IgniteCheckedException
Runs lucene fulltext query over this index.- Parameters:
qry- Query.filters- Filters over result.limit- Limits response records count. If 0 or less, the limit considered to be Integer.MAX_VALUE, that is virtually no limit.- Returns:
- Query result.
- Throws:
IgniteCheckedException- If failed.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-