ElasticSearch issues

19 views
Skip to first unread message

Nikhil Smotra

unread,
Jul 3, 2016, 2:13:38 AM7/3/16
to Lumify

It seems that the example provided  for API usage example to create AccumuloGraph does not use ElasticSearch by default.

I am using the following configuration to use create AccumuloGraph to ensure that ElasticSearch indexes are being used while saving data or retrieving data from Graph. I am using ElasticSearch version 1.4.5

Map mapConfig = new HashMap();
mapConfig.put(AccumuloGraphConfiguration.USE_SERVER_SIDE_ELEMENT_VISIBILITY_ROW_FILTER, false);
mapConfig.put(AccumuloGraphConfiguration.ACCUMULO_INSTANCE_NAME, "instance_name");
mapConfig.put(AccumuloGraphConfiguration.ACCUMULO_USERNAME, "username");
mapConfig.put(AccumuloGraphConfiguration.ACCUMULO_PASSWORD, "password");
mapConfig.put(AccumuloGraphConfiguration.ZOOKEEPER_SERVERS, "localhost");
mapConfig.put("search", "org.vertexium.elasticsearch.ElasticsearchSingleDocumentSearchIndex");
mapConfig.put("search.indexName", "instance-graph");
mapConfig.put("search.indexEdges", "false");
mapConfig.put("search.locations", "172.xxx.xxx.xxx");
mapConfig.put("search.indicesToQuery", "instance-graph");
mapConfig.put("search.clusterName", "elasticsearch");
AccumuloGraphConfiguration graphConfig = new AccumuloGraphConfiguration(mapConfig);
Graph graph = AccumuloGraph.create(graphConfig);

I am successfully able to insert a new vertex into the graph store. Let us assume that I have created a vertex with id=1 and property name="john",city="new york"

I am successfully able to search for the stored vertex using vertex id (1 for this particular example). When I try to search for an already existing vertex using a property value (say name="john"), I do not get any hit(s) from ElasticSearch. Sample code
Query graphQuery = graph.query("", authorizations);
graphQuery.has("name", "john");
// zero vertices are returned
Iterable iterableVertices = graphQuery.vertices();

Please note that if do not use ElasticSearch by commenting out all properties starting with "search" while instantiating MapConfig object in the code snipped above, I can search for vertices using either vertex id or a property value.

Could one of the experts please throw some light on how to get past this issue?

Reply all
Reply to author
Forward
0 new messages