You should use "get" or "query" for nodeIndex, for example:
IndexHits<Node> allArticles = nodeIndex.query( "*:*" ); ... do stuff ... allArticles.close(); or Node myArticle = nodeIndex.get( "name", "MyArticle" ).getSingle();
What you did above was regardless of the index, get the graph database and return all nodes.
source share