|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.index.impl.lucene.LuceneIndex<T>
public abstract class LuceneIndex<T extends PropertyContainer>
| Method Summary | |
|---|---|
void |
add(T entity,
String key,
Object value)
See Index.add(PropertyContainer, String, Object) for more generic
documentation. |
void |
delete()
Clears the index and deletes the configuration associated with it. |
IndexHits<T> |
get(String key,
Object value)
Returns exact matches from this index, given the key/value pair. |
protected abstract T |
getById(long id)
|
Integer |
getCacheCapacity(String key)
|
protected abstract long |
getEntityId(T entity)
|
GraphDatabaseService |
getGraphDatabase()
Get the graph database that owns this index. |
String |
getName()
|
boolean |
isWriteable()
A ReadableIndex is possible to support mutating operations as well. |
protected abstract org.neo4j.index.impl.lucene.LuceneCommand |
newAddCommand(PropertyContainer entity,
String key,
Object value)
|
protected abstract org.neo4j.index.impl.lucene.LuceneCommand |
newRemoveCommand(PropertyContainer entity,
String key,
Object value)
|
T |
putIfAbsent(T entity,
String key,
Object value)
Add the entity to this index for the given key/value pair if this particular key/value pair doesn't already exist. |
IndexHits<T> |
query(Object queryOrQueryObject)
Returns matches from this index based on the supplied query object, which can be a query string or an implementation-specific query object. |
protected IndexHits<T> |
query(org.apache.lucene.search.Query query,
String keyForDirectLookup,
Object valueForDirectLookup,
QueryContext additionalParametersOrNull)
|
IndexHits<T> |
query(String key,
Object queryOrQueryObject)
Returns matches from this index based on the supplied key and
query object, which can be a query string or an implementation-specific
query object. |
void |
remove(T entity)
Removes an entity from the index and all its key/value pairs which has been previously associated using Index.add(PropertyContainer, String, Object). |
void |
remove(T entity,
String key)
Removes key/value pairs for entity where key is key
from the index. |
void |
remove(T entity,
String key,
Object value)
See Index.remove(PropertyContainer, String, Object) for more
generic documentation. |
void |
setCacheCapacity(String key,
int capacity)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.neo4j.graphdb.index.ReadableIndex |
|---|
getEntityType |
| Method Detail |
|---|
public GraphDatabaseService getGraphDatabase()
ReadableIndexgraph database that owns this index.
getGraphDatabase in interface ReadableIndex<T extends PropertyContainer>graph database that owns this index.public String getName()
getName in interface ReadableIndex<T extends PropertyContainer>
public void add(T entity,
String key,
Object value)
Index.add(PropertyContainer, String, Object) for more generic
documentation.
Adds key/value to the entity in this index. Added values are
searchable within the transaction, but composite AND
queries aren't guaranteed to return added values correctly within that
transaction. When the transaction has been committed all such queries
are guaranteed to return correct results.
add in interface Index<T extends PropertyContainer>entity - the entity (i.e Node or Relationship)
to associate the key/value pair with.key - the key in the key/value pair to associate with the entity.value - the value in the key/value pair to associate with the
entity.
public T putIfAbsent(T entity,
String key,
Object value)
Index
putIfAbsent in interface Index<T extends PropertyContainer>entity - the entity (i.e Node or Relationship)
to associate the key/value pair with.key - the key in the key/value pair to associate with the entity.value - the value in the key/value pair to associate with the
entity.
null if no entity was
indexed before (and the specified entity was added to the index).
public void remove(T entity,
String key,
Object value)
Index.remove(PropertyContainer, String, Object) for more
generic documentation.
Removes key/value to the entity in this index. Removed values
are excluded within the transaction, but composite AND
queries aren't guaranteed to exclude removed values correctly within
that transaction. When the transaction has been committed all such
queries are guaranteed to return correct results.
remove in interface Index<T extends PropertyContainer>entity - the entity (i.e Node or Relationship)
to dissociate the key/value pair from.key - the key in the key/value pair to dissociate from the entity.value - the value in the key/value pair to dissociate from the
entity.
public void remove(T entity,
String key)
Indexentity where key is key
from the index.
Implementations can choose to not implement this method and should
in that case throw UnsupportedOperationException.
remove in interface Index<T extends PropertyContainer>entity - the entity (Node or Relationship) to
remove the this index.public void remove(T entity)
IndexIndex.add(PropertyContainer, String, Object).
Implementations can choose to not implement this method and should
in that case throw UnsupportedOperationException.
remove in interface Index<T extends PropertyContainer>entity - the entity (Node or Relationship) to
remove the this index.public void delete()
Index
delete in interface Index<T extends PropertyContainer>
public IndexHits<T> get(String key,
Object value)
ReadableIndex#add(PropertyContainer, String, Object) method.
get in interface ReadableIndex<T extends PropertyContainer>key - the key in the key/value pair to match.value - the value in the key/value pair to match.
IndexHits object. If the entire
result set isn't looped through, IndexHits.close() must be
called before disposing of the result.
public IndexHits<T> query(String key,
Object queryOrQueryObject)
key and
query object, which can be a query string or an implementation-specific
query object.
queryOrQueryObject can be a String containing the query
in Lucene syntax format, http://lucene.apache.org/java/3_0_2/queryparsersyntax.html.
Or it can be a Query object. If can even be a QueryContext
object which can contain a query (String or Query) and
additional parameters, such as Sort.
Because of performance issues, including uncommitted transaction modifications
in the result is disabled by default, but can be enabled using
QueryContext.tradeCorrectnessForSpeed().
query in interface ReadableIndex<T extends PropertyContainer>key - the key in this query.queryOrQueryObject - the query for the key to match.
IndexHits object. If the entire
result set isn't looped through, IndexHits.close() must be
called before disposing of the result.public IndexHits<T> query(Object queryOrQueryObject)
query in interface ReadableIndex<T extends PropertyContainer>queryOrQueryObject - the query to match.
IndexHits object. If the entire
result set isn't looped through, IndexHits.close() must be
called before disposing of the result.query(String, Object)
protected IndexHits<T> query(org.apache.lucene.search.Query query,
String keyForDirectLookup,
Object valueForDirectLookup,
QueryContext additionalParametersOrNull)
public boolean isWriteable()
ReadableIndex
isWriteable in interface ReadableIndex<T extends PropertyContainer>
public void setCacheCapacity(String key,
int capacity)
public Integer getCacheCapacity(String key)
protected abstract T getById(long id)
protected abstract long getEntityId(T entity)
protected abstract org.neo4j.index.impl.lucene.LuceneCommand newAddCommand(PropertyContainer entity,
String key,
Object value)
protected abstract org.neo4j.index.impl.lucene.LuceneCommand newRemoveCommand(PropertyContainer entity,
String key,
Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||