Could not find a suitable index to answer graph query and graph scans are disabled #3973
-
I am using JanusGraph with Cassandra as the back-end and Elasticsearch for indexing. When I try to send a query from my Python code to JanusGraph, it fails with timeout error and "Warning: please use indexing". So I enabled this flag,
This is my Janusgraph config file, storage.backend=cql
storage.cql.keyspace=education
storage.hostname=<host IP>
storage.port=9042
index.education.backend=elasticsearch
index.education.index-name=education
index.education.hostname=<elastic ip>
index.education.port=9200
index.education.elasticsearch.http.auth.type=BASIC
index.education.elasticsearch.http.auth.basic.username=<username>
index.education.elasticsearch.http.auth.basic.password=<password> I define my schema for vertex and edge like this,
which makes my indexes,
Then I insert my data, it is correctly inserted in Cassandra and Elastic. When I query it using my Python script:
It fails with the error,
I am not sure what I am missing here. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I see two issues here:
|
Beta Was this translation helpful? Give feedback.
-
I am sorry, I didn't completely get your first point. See I have to create a fresh keyspace and a fresh index, so I don't have any existing data to index, but still I'll have to ENABLE_INDEX.
If we look at this code, it fails with the same error,
Now should I do this after committing the schema changes,
or something else, can you please give an example ? One more thing, after committing the schema changes, I tried
but this keeps on showing
till it exits with a timeout.
|
Beta Was this translation helpful? Give feedback.
-
Ok, I understand that I can only use search predicate or both fields, only then it would work, so now I tried using composite index.
like this, but now it is still showing the same error
I checked the status of index, and it is showing
Am I missing something with the composite index use ? |
Beta Was this translation helpful? Give feedback.
The error messages sound to me simply like the index is already
ENABLED
so there is no need to callawaitGraphIndexStatus
on it. You can verify this by executingmanagement.printIndexes()
.You are getting this error for the traversal in
read_data()
, right? I just tried to reproduce your scenario and ran into the same problem. It looks like the mixed index is not used when it is created for multiple property keys (p_uuid
andcompany_name
in your case), but only one property key is used in the traversal and no search predicate is used.So, the index is used if both property keys are used or if a search pre…