public abstract class SolrIndex<T extends com.tinkerpop.blueprints.Element> extends java.lang.Object implements OracleIndex<T>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EDGE_ID_PROP
A constant text index field name for the ID of an edge
|
static java.lang.String |
TYPE_DT_BOOL
This constant denotes a Boolean data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_BYTE
This constant denotes a Byte data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_CHAR
This constant denotes a Character data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_DATE
This constant denotes a Date (java.util.Date) data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_DOUBLE
This constant denotes a Double data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_FLOAT
This constant denotes a Float data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_INTEGER
This constant denotes an Integer data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_JSON
This constant denotes a JSON data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_LONG
This constant denotes a Long data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_SERIALIZABLE
This constant denotes a Serializable data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_SHORT
This constant denotes a Short data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_SPATIAL
This constant denotes a Spatial data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_STRING
This constant denotes a String data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
TYPE_DT_URI
This constant denotes an URI data type for the value field of an attribute (K/V pair)
|
static java.lang.String |
VERSION_PROP
This constant denotes an identifier for the version field of a document within the text index
|
static java.lang.String |
VERTEX_ID_PROP
A constant text index field name for the ID of a vertex
|
EDGE_LABEL_PROP, END_NODE_ID_PROP, m_dtValues, START_NODE_ID_PROP
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Adds a new element into the index using all its key/value pairs.
|
void |
add(T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Adds a new element into the index using all its key/value pairs.
|
java.lang.String |
appendDatatypesSuffixToKey(java.lang.String key, java.lang.Class dtValue)
This operation will append the data type suffix to the key based on the LuceneIndex configuration.
|
java.lang.String |
appendDatatypesSuffixToValue(java.lang.Object value, java.lang.Class dtValue)
This operation will append the data type suffix to the String representation of the given value based on the LuceneIndex configuration.
|
java.lang.String |
buildSearchTerm(java.lang.String key, java.lang.Object value)
Builds a search term query expression in the syntax required by this index.
|
java.lang.String |
buildSearchTerm(java.lang.String key, java.lang.Object value, java.lang.Class dtClass)
Builds a search term query expression in the syntax required by this index.
|
void |
clearIndex()
Clears all data stored in the index.
|
void |
close()
Closes this SolrIndex object
|
void |
commit()
Commit changes
|
void |
commit(org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Commit changes using the given CloudSolrServer object
|
long |
count(java.lang.String key, java.lang.Object value)
Counts all the elements matching the specified K/V property within the index
|
long |
count(java.lang.String key, java.lang.Object value, boolean acceptWildcard)
Counts all the elements matching the specified K/V property within the index
|
long |
count(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard)
Counts all the elements matching the specified K/V property within the index
|
void |
dropIndex()
Drops the index data
|
abstract com.tinkerpop.blueprints.CloseableIterable<T> |
get(java.lang.Object solrQuery)
Gets an Iterable object with all the matching elements that match the given query object.
|
com.tinkerpop.blueprints.CloseableIterable<T> |
get(java.lang.String key, java.lang.Object value)
Gets all the elements matching the specified K/V property within the index
|
com.tinkerpop.blueprints.CloseableIterable<T> |
get(java.lang.String key, java.lang.Object value, boolean acceptWildcard)
Gets all the elements matching the specified K/V property within the index
|
abstract com.tinkerpop.blueprints.CloseableIterable<T> |
get(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard)
Gets all the elements matching the specified K/V property within the index
|
org.apache.solr.client.solrj.impl.CloudSolrServer |
getCloudSolrServer(long timeout)
Gets a new CloudSolrServer object to handle operations over the index.
|
java.lang.String |
getDirectoryName()
Gets the directory name for this index.
|
java.lang.String |
getDocIdentifier()
Get index document's identifier.
|
java.lang.String |
getGraphName()
Get the name of the associated graph
|
java.lang.Class<T> |
getIndexClass()
Gets the element class associated to this index.
|
java.lang.String |
getIndexName()
Gets the name of this index instance.
|
SolrParameters |
getIndexParameters()
Gets the index parameters utility associated to this index.
|
OracleIndexParameters |
getOracleIndexParameters()
Gets an
OracleIndexParameters wrapping the parameters associated to this index |
com.tinkerpop.blueprints.Parameter<java.lang.String,java.lang.Object>[] |
getParameters()
Gets the Parameters associated to this index.
|
abstract com.tinkerpop.blueprints.CloseableIterable<T>[] |
getPartitioned(java.lang.Object[] connections, java.lang.Object query, int startShardId)
Gets an array of
CloseableIterable objects that hold all the elements with an attribute matching the given K/V pair. |
com.tinkerpop.blueprints.CloseableIterable<T>[] |
getPartitioned(java.lang.Object[] connections, java.lang.String key, java.lang.Object value, boolean acceptWildcard, int startShardId)
Gets an array of
CloseableIterable objects that hold all the elements with an attribute matching the given K/V pair. |
abstract com.tinkerpop.blueprints.CloseableIterable<T>[] |
getPartitioned(java.lang.Object[] connections, java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard, int startShardId)
Gets an array of
CloseableIterable objects that hold all the elements with an attribute matching the given K/V pair. |
java.util.List<java.lang.String> |
getShardsNames()
Gets the list of shards' names used for this SolrCloud index
|
int |
getTotalShards()
Gets the number of shards (directories) in this index
|
int |
getTotalShards(org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Gets the number of shards (directories) in this index
|
void |
put(java.lang.String key, java.lang.Object value, T element)
Indexes an element by a key and a value.
|
void |
put(java.lang.String key, java.lang.Object value, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Indexes an element by a key and a value.
|
com.tinkerpop.blueprints.CloseableIterable<T> |
query(java.lang.String key, java.lang.Object value)
Query for all the elements matching the specified K/V property within the index
|
com.tinkerpop.blueprints.CloseableIterable<T> |
query(java.lang.String key, java.lang.Object value, boolean useWildcards)
Query for all the elements matching the specified K/V property within the index
|
void |
remove(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Removes an element indexed by a particular key/value.
|
void |
remove(java.lang.String key, java.lang.Object value, T element)
Removes an element indexed by a particular key/value.
|
void |
remove(java.lang.String key, java.lang.Object value, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
Removes an element indexed by a particular key/value.
|
void |
remove(T element)
Deletes an element from this index
|
void |
removeAll(java.lang.String key)
Removes all the elements from the index matching the specified key.
|
public static final java.lang.String EDGE_ID_PROP
public static final java.lang.String TYPE_DT_BOOL
public static final java.lang.String TYPE_DT_BYTE
public static final java.lang.String TYPE_DT_CHAR
public static final java.lang.String TYPE_DT_DATE
public static final java.lang.String TYPE_DT_DOUBLE
public static final java.lang.String TYPE_DT_FLOAT
public static final java.lang.String TYPE_DT_INTEGER
public static final java.lang.String TYPE_DT_JSON
public static final java.lang.String TYPE_DT_LONG
public static final java.lang.String TYPE_DT_SERIALIZABLE
public static final java.lang.String TYPE_DT_SHORT
public static final java.lang.String TYPE_DT_SPATIAL
public static final java.lang.String TYPE_DT_STRING
public static final java.lang.String TYPE_DT_URI
public static final java.lang.String VERSION_PROP
public static final java.lang.String VERTEX_ID_PROP
public void add(T element)
add
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
element
- a Element
object.java.io.IOException
public void add(T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
element
- a Element
object.cloudSolrServer
- if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.java.io.IOException
public java.lang.String appendDatatypesSuffixToKey(java.lang.String key, java.lang.Class dtValue)
key
- the key of the K/V propertydtValue
- the data type of the value objectpublic java.lang.String appendDatatypesSuffixToValue(java.lang.Object value, java.lang.Class dtValue)
value
- the value of the K/V propertydtValue
- the data type of the value objectpublic java.lang.String buildSearchTerm(java.lang.String key, java.lang.Object value)
buildSearchTerm
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertypublic java.lang.String buildSearchTerm(java.lang.String key, java.lang.Object value, java.lang.Class dtClass)
buildSearchTerm
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertydtClass
- the class representing the datatype of the property value. This can be used to cast the property value to a different datatype. For example, if the value is "3.01" and dtClass is Float.Class, then this value will be treated as a 3.01f.public void clearIndex()
clearIndex
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public void close()
close
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public void commit()
commit
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public void commit(org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
public final long count(java.lang.String key, java.lang.Object value)
count
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertypublic final long count(java.lang.String key, java.lang.Object value, boolean acceptWildcard)
count
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyacceptWildcard
- specifies if wild cards can be used in the value object.CloseableIterable
object.public long count(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard)
count
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyacceptWildcard
- specifies if wild cards can be used in the value object.dtClass
- the class representing the datatype of the property value. This can be used to cast the property value to a different datatype. For example, if the value is "3.01" and dtClass is Float.Class, then this value will be treated as a 3.01f.public final void dropIndex()
dropIndex
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public abstract com.tinkerpop.blueprints.CloseableIterable<T> get(java.lang.Object solrQuery)
get
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
solrQuery
- a object representing the text query to execute.CloseableIterable
object.public final com.tinkerpop.blueprints.CloseableIterable<T> get(java.lang.String key, java.lang.Object value)
get
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyCloseableIterable
object.public final com.tinkerpop.blueprints.CloseableIterable<T> get(java.lang.String key, java.lang.Object value, boolean acceptWildcard)
get
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyacceptWildcard
- specifies if wild cards can be used in the value object.CloseableIterable
object.public abstract com.tinkerpop.blueprints.CloseableIterable<T> get(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard)
get
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertydtClass
- the class representing the datatype of the searched values.acceptWildcard
- specifies if wild cards can be used in the value object.CloseableIterable
object.public org.apache.solr.client.solrj.impl.CloudSolrServer getCloudSolrServer(long timeout)
public final java.lang.String getDirectoryName()
getDirectoryName
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public java.lang.String getDocIdentifier()
getDocIdentifier
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public final java.lang.String getGraphName()
getGraphName
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public final java.lang.Class<T> getIndexClass()
getIndexClass
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
getIndexClass
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public final java.lang.String getIndexName()
getIndexName
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
public SolrParameters getIndexParameters()
SolrParameters
object.public OracleIndexParameters getOracleIndexParameters()
OracleIndexParameters
wrapping the parameters associated to this indexgetOracleIndexParameters
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
OracleIndexParameters
object.public com.tinkerpop.blueprints.Parameter<java.lang.String,java.lang.Object>[] getParameters()
getParameters
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
Parameter
array.public abstract com.tinkerpop.blueprints.CloseableIterable<T>[] getPartitioned(java.lang.Object[] connections, java.lang.Object query, int startShardId)
CloseableIterable
objects that hold all the elements with an attribute matching the given K/V pair. This object can be either a String text search query, a SolrQuery object or a QueryResponse from SolrCloud. Each element in the CloseableIterable
array uses a separate connection provided to fetch a subset of the results from a corresponding SolrCloud shard. Note that we assign an integer ID (in the range of [0, N - 1]) to all the shards in a SolrCloud cluster with N shards. The subset of shards queried will consist of those shards with ID value in the range of [startShardId, startShardId - 1 + size of connections array].getPartitioned
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
connections
- an array of connections to the SolrCloud. Each element of this array should be of type CloudSolrServer. See getCloudSolrServer(long)
.startShardId
- the ID of the starting shard.query
- the query object.CloseableIterable
object.public final com.tinkerpop.blueprints.CloseableIterable<T>[] getPartitioned(java.lang.Object[] connections, java.lang.String key, java.lang.Object value, boolean acceptWildcard, int startShardId)
CloseableIterable
objects that hold all the elements with an attribute matching the given K/V pair. Each element in the CloseableIterable
array uses a separate connection provided to fetch a subset of the results from a corresponding SolrCloud shard. Note that we assign an integer ID (in the range of [0, N - 1]) to all the shards in a SolrCloud cluster with N shards. The subset of shards queried will consist of those shards with ID value in the range of [startShardId, startShardId - 1 + size of connections array].getPartitioned
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
connections
- an array of connections to the SolrCloud. Each element of this array should be of type CloudSolrServer. See getCloudSolrServer(long)
.key
- the key of a propertyvalue
- the value object of the property.acceptWildcard
- specifies if wild cards can be used in the value object.startShardId
- the ID of the starting shard.CloseableIterable
object.public abstract com.tinkerpop.blueprints.CloseableIterable<T>[] getPartitioned(java.lang.Object[] connections, java.lang.String key, java.lang.Object value, java.lang.Class dtClass, boolean acceptWildcard, int startShardId)
CloseableIterable
objects that hold all the elements with an attribute matching the given K/V pair. Each element in the CloseableIterable
array uses a separate connection provided to fetch a subset of the results from a corresponding SolrCloud shard. Note that we assign an integer ID (in the range of [0, N - 1]) to all the shards in a SolrCloud cluster with N shards. The subset of shards queried will consist of those shards with ID value in the range of [startShardId, startShardId - 1 + size of connections array].getPartitioned
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
connections
- an array of connections to the SolrCloud. Each element of this array should be of type CloudSolrServer. See getCloudSolrServer(long)
.key
- the key of a propertyvalue
- the value object of the property.dtClass
- the class representing the datatype of the property value. This can be used to cast the property value to a different datatype. For example, if the value is "3.01" and dtClass is Float.Class, then this value will be treated as a 3.01f.acceptWildcard
- specifies if wild cards can be used in the value object.startShardId
- the ID of the starting shard.CloseableIterable
object.public java.util.List<java.lang.String> getShardsNames()
public int getTotalShards()
getTotalShards
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
public int getTotalShards(org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
cloudSolrServer
- if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.public void put(java.lang.String key, java.lang.Object value, T element)
put
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
key
- the key to index the element by.value
- the value to index the element by.element
- the element to index.public void put(java.lang.String key, java.lang.Object value, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
key
- the key to index the element by.value
- the value to index the element by.element
- the element to index.cloudSolrServer
- if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.public final com.tinkerpop.blueprints.CloseableIterable<T> query(java.lang.String key, java.lang.Object value)
query
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyCloseableIterable
object.public final com.tinkerpop.blueprints.CloseableIterable<T> query(java.lang.String key, java.lang.Object value, boolean useWildcards)
query
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key of the K/V propertyvalue
- the value object of the K/V propertyuseWildcards
- specifies if wild cards can be used in the value object.CloseableIterable
object.public void remove(java.lang.String key, java.lang.Object value, java.lang.Class dtClass, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
key
- the key of the indexed element.value
- the value of the indexed element.dtClass
- the data type class of the indexed element.element
- the element to remove given the key/value pair.cloudSolrServer
- if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.public void remove(java.lang.String key, java.lang.Object value, T element)
remove
in interface com.tinkerpop.blueprints.Index<T extends com.tinkerpop.blueprints.Element>
key
- the key of the indexed element.value
- the value of the indexed element.element
- the element to remove given the key/value pair.public void remove(java.lang.String key, java.lang.Object value, T element, org.apache.solr.client.solrj.impl.CloudSolrServer cloudSolrServer)
key
- the key of the indexed element.value
- the value of the indexed element.element
- the element to remove given the key/value pair.cloudSolrServer
- if not null, use the opened CloudSolrServer connection, this avoids opening/closing a CloudSolrServer connection at flush time.public void remove(T element)
remove
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
element
- an Element
object.java.io.IOException
public void removeAll(java.lang.String key)
removeAll
in interface OracleIndex<T extends com.tinkerpop.blueprints.Element>
key
- the key to remove from the index.Copyright © 2017, 2018 Oracle and/or its affiliates. All Rights Reserved.