org.neo4j.index.impl.lucene
Class LuceneIndex<T extends org.neo4j.graphdb.PropertyContainer>

java.lang.Object
  extended by org.neo4j.index.impl.lucene.LuceneIndex<T>
All Implemented Interfaces:
org.neo4j.graphdb.index.Index<T>, org.neo4j.graphdb.index.ReadableIndex<T>

public abstract class LuceneIndex<T extends org.neo4j.graphdb.PropertyContainer>
extends Object
implements org.neo4j.graphdb.index.Index<T>


Method Summary
 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)
           
protected abstract  T getById(long id)
           
 Integer getCacheCapacity(String key)
           
protected abstract  long getEntityId(T entity)
           
 org.neo4j.graphdb.GraphDatabaseService getGraphDatabase()
           
 String getName()
           
 boolean isWriteable()
           
protected abstract  org.neo4j.index.impl.lucene.LuceneCommand newAddCommand(org.neo4j.graphdb.PropertyContainer entity, String key, Object value)
           
protected abstract  org.neo4j.index.impl.lucene.LuceneCommand newRemoveCommand(org.neo4j.graphdb.PropertyContainer entity, String key, Object value)
           
 T putIfAbsent(T entity, String key, Object value)
           
 org.neo4j.graphdb.index.IndexHits<T> query(Object queryOrQueryObject)
          
protected  org.neo4j.graphdb.index.IndexHits<T> query(org.apache.lucene.search.Query query, String keyForDirectLookup, Object valueForDirectLookup, QueryContext additionalParametersOrNull)
           
 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)
           
 
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

getGraphDatabase

public org.neo4j.graphdb.GraphDatabaseService getGraphDatabase()
Specified by:
getGraphDatabase in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>

getName

public String getName()
Specified by:
getName in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>

add

public void add(T entity,
                String key,
                Object value)
See 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.

Specified by:
add in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
Parameters:
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.

putIfAbsent

public T putIfAbsent(T entity,
                     String key,
                     Object value)
Specified by:
putIfAbsent in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>

remove

public void remove(T entity,
                   String key,
                   Object value)
See 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.

Specified by:
remove in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>
Parameters:
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.

remove

public void remove(T entity,
                   String key)
Specified by:
remove in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>

remove

public void remove(T entity)
Specified by:
remove in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>

delete

public void delete()
Specified by:
delete in interface org.neo4j.graphdb.index.Index<T extends org.neo4j.graphdb.PropertyContainer>

get

public org.neo4j.graphdb.index.IndexHits<T> get(String key,
                                                Object value)
Specified by:
get in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>

query

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().

Specified by:
query in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>

query

public org.neo4j.graphdb.index.IndexHits<T> query(Object queryOrQueryObject)

Specified by:
query in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>
See Also:
query(String, Object)

query

protected org.neo4j.graphdb.index.IndexHits<T> query(org.apache.lucene.search.Query query,
                                                     String keyForDirectLookup,
                                                     Object valueForDirectLookup,
                                                     QueryContext additionalParametersOrNull)

isWriteable

public boolean isWriteable()
Specified by:
isWriteable in interface org.neo4j.graphdb.index.ReadableIndex<T extends org.neo4j.graphdb.PropertyContainer>

setCacheCapacity

public void setCacheCapacity(String key,
                             int capacity)

getCacheCapacity

public Integer getCacheCapacity(String key)

getById

protected abstract T getById(long id)

getEntityId

protected abstract long getEntityId(T entity)

newAddCommand

protected abstract org.neo4j.index.impl.lucene.LuceneCommand newAddCommand(org.neo4j.graphdb.PropertyContainer entity,
                                                                           String key,
                                                                           Object value)

newRemoveCommand

protected abstract org.neo4j.index.impl.lucene.LuceneCommand newRemoveCommand(org.neo4j.graphdb.PropertyContainer entity,
                                                                              String key,
                                                                              Object value)


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.