Using search indexes
Using search indexes for graph traversals.
DSE Graph can use search indexes
that take advantage of DSE Search functionality for efficient traversal queries. DSE
Search uses a modified Apache Solr to create
the search indexes. Graph search indexes can be created using
asText()
for full text tokenized search or
asString()
for exact string matching. Each option has
advantages, depending on the type of search that will be required in graph
traversals.
It is important to note that these traversal queries will fail if a search index is not created previous to using the query. Create search indexes during schema creation before inserting data and querying the graph. Search indexes will only be created if DSE Search is started in conjunction with DSE Graph.
In general, the traversal step will involve a vertex label and can include a property
key and a particular property value. In a traversal, the step following
g.V()
is generally the step in which an index will be
consulted. If a mid-traversal V()
step is called, then an
additional indexed step can be consulted to narrow the list of vertices that will be
traversed.
asText()
can use the following
options for search:
Property key indexes defined with asString()
can use the
following options for search:
eq()
search cannot be used with property key indexes
created with asText()
because they contain tokenized data and
are therefore not suitable for exact text matches.Procedure
Creating a search index
Search using token() methods on full text
Search using tokenPrefix() methods on full text
Search using tokenRegex() methods on full text
Search using eq() on non-token methods on strings
Search using prefix() on non-token methods on strings
Search using regex() on non-token methods on strings
Using two search indexes for a single traversal query
Search using geospatial values