Date
1 - 2 of 2
separate elastic search for separate graph
hadoopmarc@...
I had to try for myself and, indeed, the ref docs are not very clear about this. In order to give the second graph a separate, independent mixed ndex
you have to adapt the properties file for the second graph like (in this case a variant on janusgraph-cql-es.properties):
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=cql
storage.hostname=127.0.0.1
storage.cql.keyspace=janusgraph2
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.25
index.search2.backend=elasticsearch
index.search2.hostname=127.0.0.1
index.search2.index-name=janusgraph2
After loading the graphs you can check against the indexing backend:
$ curl http://127.0.0.1:9200/_cat/indices
green open .geoip_databases O7iNY_U4Sui1yfFontk3lA 1 0 42 0 38.8mb 38.8mb
yellow open janusgraph_edges OfbruO3BRIOPLMVYwUSWRw 1 1 6 0 4.4kb 4.4kb
yellow open janusgraph_vertices EGmMEvXuQXiIxTasEnSIDw 1 1 6 0 3.8kb 3.8kb
yellow open janusgraph2_vertices UQITuYsnTA2d2J8MyyblLA 1 1 6 0 3.8kb 3.8kb
yellow open janusgraph2_edges d1ZOPXVSTze0HQkg_vEz1A 1 1 6 0 4.4kb 4.4kb
Also, if you use the GraphOfTheGodsFactory for testing with two graphs, you have to use it like:
gremlin> GraphOfTheGodsFactory.load(graph1, 'search', false)
gremlin> GraphOfTheGodsFactory.load(graph2, 'search2', false)
I did not check if this can work for the ConfigurationGraphFactory, but if you find this impossible either of us should report an issue
for it (together with extending the ref docs with the above) .
Best wishes, Marc
you have to adapt the properties file for the second graph like (in this case a variant on janusgraph-cql-es.properties):
gremlin.graph=org.janusgraph.core.JanusGraphFactory
storage.backend=cql
storage.hostname=127.0.0.1
storage.cql.keyspace=janusgraph2
cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.25
index.search2.backend=elasticsearch
index.search2.hostname=127.0.0.1
index.search2.index-name=janusgraph2
After loading the graphs you can check against the indexing backend:
$ curl http://127.0.0.1:9200/_cat/indices
green open .geoip_databases O7iNY_U4Sui1yfFontk3lA 1 0 42 0 38.8mb 38.8mb
yellow open janusgraph_edges OfbruO3BRIOPLMVYwUSWRw 1 1 6 0 4.4kb 4.4kb
yellow open janusgraph_vertices EGmMEvXuQXiIxTasEnSIDw 1 1 6 0 3.8kb 3.8kb
yellow open janusgraph2_vertices UQITuYsnTA2d2J8MyyblLA 1 1 6 0 3.8kb 3.8kb
yellow open janusgraph2_edges d1ZOPXVSTze0HQkg_vEz1A 1 1 6 0 4.4kb 4.4kb
Also, if you use the GraphOfTheGodsFactory for testing with two graphs, you have to use it like:
gremlin> GraphOfTheGodsFactory.load(graph1, 'search', false)
gremlin> GraphOfTheGodsFactory.load(graph2, 'search2', false)
I did not check if this can work for the ConfigurationGraphFactory, but if you find this impossible either of us should report an issue
for it (together with extending the ref docs with the above) .
Best wishes, Marc
51kumarakhil@...
Hi! I've setup elastic search for configurationGraphFactory and Bigtable, using below configurations
Configurations:
Configurations:
storage.lock.wait-time=100
storage.hbase.ext.google.bigtable.instance.id=<bigtable-id>
index.search.hostname=<host-name>
index.search.index-name=janusgraph_metadata
index.search.port=9243
index.search.elasticsearch.ssl.enabled=true
index.search.elasticsearch.http.auth.basic.password=<password>
index.search.elasticsearch.http.auth.type=basic
index.search.elasticsearch.http.auth.basic.username=<username>
storage.backend=hbase
storage.hostname=localhost
schema.default=none
storage.batch-loading=true
storage.hbase.ext.google.bigtable.project.id=<project-id>
graph.timestamps=MICRO
index.search.elasticsearch.connect-timeout=10000000
index.search.backend=elasticsearch
storage.hbase.ext.hbase.client.connection.impl=com.google.cloud.bigtable.hbase2_x.BigtableConnection
storage.hbase.keyspace=jgex
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Create Graph
ConfiguredGraphFactory.create('graph_01')
Adding MixedIndex on property 'name'
mgmt = graph_01.openManagement();
mgmt.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.single).make();
name = mgmt.getPropertyKey("nome");
mgmt.buildIndex('byNomeUniqueMixed', Vertex.class).addKey(name, Mapping.TEXTSTRING.asParameter()).buildMixedIndex("search");
mgmt.commit();
Adding Data
graph_01_traversal.addV('person').property('name', 'Tom Cruise')
Fetching Data
graph_01_traversal.V().has("name", textPrefix("Tom"))
output: v[6753]
Query #1: Is this the correct way to setup elastic search?
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Using above approach only, if I create a new graph
graph_02 (,say). With same configurations and mixedIndex.
And if I add a data
graph_02_traversal.addV('person').property('name', 'Tom Holand')
And if I try to fetch this it
graph_02_traversal.V().has("name", textPrefix("Tom Holand"))
output:
v[6753]
v[9785]
here, I'm getting data from graph_01 as well despite using graph_02_traversal in the 'has' query
Question #2: Is there a way to setup a separate ES for a graph
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Create Graph
ConfiguredGraphFactory.create('graph_01')
Adding MixedIndex on property 'name'
mgmt = graph_01.openManagement();
mgmt.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.single).make();
name = mgmt.getPropertyKey("nome");
mgmt.buildIndex('byNomeUniqueMixed', Vertex.class).addKey(name, Mapping.TEXTSTRING.asParameter()).buildMixedIndex("search");
mgmt.commit();
Adding Data
graph_01_traversal.addV('person').property('name', 'Tom Cruise')
Fetching Data
graph_01_traversal.V().has("name", textPrefix("Tom"))
output: v[6753]
Query #1: Is this the correct way to setup elastic search?
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Using above approach only, if I create a new graph
graph_02 (,say). With same configurations and mixedIndex.
And if I add a data
graph_02_traversal.addV('person').property('name', 'Tom Holand')
And if I try to fetch this it
graph_02_traversal.V().has("name", textPrefix("Tom Holand"))
output:
v[6753]
v[9785]
here, I'm getting data from graph_01 as well despite using graph_02_traversal in the 'has' query
Question #2: Is there a way to setup a separate ES for a graph