0
votes

I want to count the relationships by type in Neo4j using neo4j native java Api (not execute Cyper statement)

I create a full-text index in relationships by calling procedure

CALL db.index.fulltext.createRelationshipIndex(
  "dependsTypeRelationshipIndex",
  ["DEPENDS"], ["isoptional"], 
  { analyzer: "standard", eventually_consistent: "true" })

The index has been created suffcessfully : enter image description here

Also, there are existing correspondingly relationships : enter image description here

However, when I using neo4j native api, it does not work. enter image description here

Is there any config I need to set, or method to count the relationships by type without using Cypher?

1
How do you define "does not work", is there any error logs?Litchy
@Litchy Well, no error log, but the IndexHits<Relationship> size is supposed to be over 0 while it is 0 in the last picturewuxue

1 Answers

0
votes

In neo4j 3.5.*, for the relationship, there are two types of index, explicit index and full-text index. However, in the neo4j java native API, there is only an index manager for the explicit index, which is the reason I can't get my full-text index. So I can only query the full-text index by using the Cypher statement which is a conflict to my condition.

I hope there will be an index manager for the full-text index in the future neo4j java native API.