Hi,
autoindexing is probably what you're looking for. Note that switching on
autoindexing does not pick up previously existing contents into the
index, it only tracks changes from the timepoint of the config change on.
To index prexisiting contents iterate over all nodes/relationships and
set the respective properties with their existing values:
GlobalGraphOperations ggo = GlobalGraphOperations.at(graphDb);
for (Node node: ggo.getAllNodes()) {
for (String key: graphDb.index().getNodeAutoIndexer()
.getAutoIndexedProperties() ) {
node.setProperty(key, node.getProperty(key));
}
}
for (Relationship rel: ggo.getAllRelationships()) {
for (String key: graphDb.index().getRelationshipAutoIndexer()
.getAutoIndexedProperties() ) {
rel.setProperty(key, rel.getProperty(key));
}
}
And yes, you can configure the underlying index. Be careful, this must
be done at the very first setup of the index. See
http://docs.neo4j.org/chunked/stable/indexing-create-advanced.html, note
that when configuring the autoindex, you have to use the magic names
"node_auto_index" and "relationship_auto_index".
Regards,
Stefan