public abstract class LuceneIndex<T extends org.neo4j.graphdb.PropertyContainer> extends Object implements org.neo4j.graphdb.index.Index<T>
Modifier and Type | Method and Description |
---|---|
void |
add(T entity,
String key,
Object value)
See
Index.add(PropertyContainer, String, Object) for more generic
documentation. |
void |
delete() |
org.neo4j.graphdb.index.IndexHits<T> |
get(String key,
Object value) |
Integer |
getCacheCapacity(String key) |
org.neo4j.graphdb.GraphDatabaseService |
getGraphDatabase() |
String |
getName() |
boolean |
isWriteable() |
T |
putIfAbsent(T entity,
String key,
Object value) |
org.neo4j.graphdb.index.IndexHits<T> |
query(Object queryOrQueryObject) |
org.neo4j.graphdb.index.IndexHits<T> |
query(String key,
Object queryOrQueryObject)
queryOrQueryObject can be a String containing the query
in Lucene syntax format, http://lucene.apache.org/java/3_0_2/queryparsersyntax.html. |
void |
remove(T entity) |
void |
remove(T entity,
String key) |
void |
remove(T entity,
String key,
Object value)
See
Index.remove(PropertyContainer, String, Object) for more
generic documentation. |
void |
setCacheCapacity(String key,
int capacity) |
public org.neo4j.graphdb.GraphDatabaseService getGraphDatabase()
getGraphDatabase
in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
public String getName()
getName
in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.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 org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.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)
putIfAbsent
in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
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 org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.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)
remove
in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
public void remove(T entity)
remove
in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
public void delete()
delete
in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
public org.neo4j.graphdb.index.IndexHits<T> get(String key, Object value)
get
in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
public org.neo4j.graphdb.index.IndexHits<T> query(String key, Object queryOrQueryObject)
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 org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
public org.neo4j.graphdb.index.IndexHits<T> query(Object queryOrQueryObject)
query
in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
query(String, Object)
public boolean isWriteable()
isWriteable
in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
public void setCacheCapacity(String key, int capacity)
Copyright © 2002–2015 The Neo4j Graph Database Project. All rights reserved.