Hello,
I created a full-text index on a node property. However, I notices that whenever the Redis instance is restarted the index disappears and I need to run the index creation command again. Is there a way to persist the index?
- The data persistence of my RedisGraph instance works fine.
Thanks!
Using the latest (2.2.6) docker hub image, I’m able to create a graph with a full-text index dump and restore it, see following:
127.0.0.1:6379> MODULE LIST
1) 1) "name"
2) "graph"
3) "ver"
4) (integer) 20206
127.0.0.1:6379> GRAPH.QUERY g "CREATE (:Movie {title:'abcde'})"
127.0.0.1:6379> GRAPH.QUERY g "CREATE (:Movie {title:'bcdef'})"
127.0.0.1:6379> GRAPH.QUERY g "CREATE (:Movie {title:'ccdefg'})"
127.0.0.1:6379> GRAPH.QUERY g "CALL db.idx.fulltext.createNodeIndex('Movie', 'title')"
127.0.0.1:6379> GRAPH.EXPLAIN g "CALL db.idx.fulltext.queryNodes('Movie', 'Book') YIELD node RETURN node.title"
1) "Results"
2) " Project"
3) " ProcedureCall"
127.0.0.1:6379> DUMP g
"\a\x81\x82\xb6\xa9\x85\xd6\xadh\a\x05\x02g\x00\x02\x03\x02\x00\x02\x01\x02\x00\x02\x01\x02\x05\x02\x01\x02\x03\x02\x02\x02\x00\x02\x03\x02\x00\x02\x04\x02\x00\x02\x05\x02\x01\x02\x00\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\x06abcde\x00\x02\x01\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\x06bcdef\x00\x02\x02\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\accdefg\x00\x02\x01\x05\x06title\x00\x02\x01\x02\x00\x05\x06Movie\x00\x02\x01\x02\x02\x05\x06title\x00\x02\x00\x00\t\x00\x1d<\x93J\xb85@s"
127.0.0.1:6379> DEL g
(integer) 1
127.0.0.1:6379> RESTORE g 0 "\a\x81\x82\xb6\xa9\x85\xd6\xadh\a\x05\x02g\x00\x02\x03\x02\x00\x02\x01\x02\x00\x02\x01\x02\x05\x02\x01\x02\x03\x02\x02\x02\x00\x02\x03\x02\x00\x02\x04\x02\x00\x02\x05\x02\x01\x02\x00\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\x06abcde\x00\x02\x01\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\x06bcdef\x00\x02\x02\x02\x01\x02\x00\x02\x01\x02\x00\x02H\x00\x05\accdefg\x00\x02\x01\x05\x06title\x00\x02\x01\x02\x00\x05\x06Movie\x00\x02\x01\x02\x02\x05\x06title\x00\x02\x00\x00\t\x00\x1d<\x93J\xb85@s"
OK
127.0.0.1:6379> keys *
1) "g"
127.0.0.1:6379> GRAPH.QUERY g "CALL db.idx.fulltext.queryNodes('Movie', 'abc*') YIELD node RETURN node.title"
1) 1) "node.title"
2) 1) 1) "abcde"
3) 1) "Cached execution: 0"
2) "Query internal execution time: 1.520300 milliseconds"
Thank you very much for looking into this. I will check my setup and again and see where it went wrong.