2017-04-18 5 views
1

Ich werde meine Neo4j Anwendung mit Elasticsearch integrieren. Ich werde versuchen, das folgende Neo4j-Plugin von GraphAware https://github.com/graphaware/neo4j-to-elasticsearchNeo4j 3.1.3 mit Elasticsearch Integration

Könnten Sie bitte sagen, unterstützt es Neo4j 3.1.3 Version? Auch welche Version von ES sollte dort verwendet werden? Unterstützt es zum Beispiel ES 5.3.0?

Momentan habe ich Elasticsearch 5.3.0 lokal installiert. Auch habe ich 2 Gläser hinzugefügt:

graphaware-neo4j-to-elasticsearch-3.1.3.45.7.jar 
graphaware-server-community-all-3.1.3.46.jar 

meinen Neo4j CE 3.1.3\plugins\ Ordner.

Außerdem habe ich die folgende Konfiguration hinzugefügt (als descrbed hier https://github.com/neo4j-contrib/neo4j-elasticsearch#example) Linien in meiner Datenbank-Konfiguration (Neo4j Community Edition\neo4j.conf):

elasticsearch.host_name=http://localhost:9200 
elasticsearch.index_spec=decisions:Decision(name,description) 

Aber wenn ich die Daten durch Spring Data Neo4j Projekt nichts passiert einfügen. Die Elasticsearch-Indizes sind noch leer.

Was mache ich falsch und wie funktioniert es?

AKTUALISIERT ich auf diese einige Fortschritte gemacht:

Das ist mein Neo4j.conf:

dbms.unmanaged_extension_classes=com.graphaware.server=/graphaware 

com.graphaware.runtime.enabled=true 

com.graphaware.module.ES.2=com.graphaware.module.es.ElasticSearchModuleBootstrapper 

com.graphaware.module.UIDM.uuidProperty=ID() 
com.graphaware.module.ES.node=hasLabel('Decision') 
com.graphaware.module.ES.relationship=(false) 

com.graphaware.module.ES.uri=localhost 
com.graphaware.module.ES.port=9200 

com.graphaware.module.ES.index=neo4j-index 

In meiner Anwendung habe ich eine Einheit: Decision. Decision ist ein komplexer Typ mit einer großen Hierarchie parent:

Decision extends Commentable extends Votable extends Flaggable ... and so on.

Gerade jetzt ~ 60 Entscheidungsknoten meiner Neo4j Datenbank Ich füge aber ich bin nicht in der Lage, alle von ihnen in ES zu sehen. Ich kann nur die erste mit einer Duplizierung pro Elternklasse in der Hierarchie sehen.

Das, was was ich jetzt habe:

$ curl -XGET 'http://127.0.0.1:9200/neo4j-index-node/_search?pretty=true&q=*:*' 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0{ 
    "took" : 1, 
    "timed_out" : false, 
    "_shards" : { 
    "total" : 5, 
    "successful" : 5, 
    "failed" : 0 
    }, 
    "hits" : { 
    "total" : 8, 
    "max_score" : 1.0, 
    "hits" : [ { 
     "_index" : "neo4j-index-node", 
     "_type" : "Decision", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Authorable", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Subscribable", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "BaseEntity", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Votable", 
100 7842 100 7842 0  0 7842  0 0:00:01 --:--:-- 0:00:01 7658kl", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Flaggable", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Likeable", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    }, { 
     "_index" : "neo4j-index-node", 
     "_type" : "Commentable", 
     "_id" : "null", 
     "_score" : 1.0, 
     "_source" : { 
     "avgVotesWeight" : 0.0, 
     "updateDate" : "2017-04-19T09:17:36.883Z", 
     "nameSlug" : "antivirus-software-for-windows", 
     "lowerName" : "antivirus software for windows", 
     "description" : "This is a non-exhaustive list of notable antivirus and Internet Security software, in the form of comparison tables, according to their platform (e.g. desktop and server, mobile, etc.)", 
     "totalDislikes" : 0, 
     "totalChildDecisions" : 59, 
     "totalCriteria" : 19, 
     "multiVotesAllowed" : false, 
     "totalCharacteristics" : 8, 
     "totalComments" : 0, 
     "totalFlags" : 0, 
     "likeSum" : 0.0, 
     "totalVotes" : 665, 
     "name" : "Antivirus software for Windows", 
     "totalLikes" : 0, 
     "createDate" : "2017-04-19T09:17:20.347Z" 
     } 
    } ] 
    } 
} 

Warum alle die Unterklassen der Entscheidung (wie Votable, Likeable) auch dort dupliziert werden? Wie Sie aus meiner Config sehen Ich habe versucht, außer alles auszuschließen:

com.graphaware.module.ES.node=hasLabel('Decision')

Mein Ziel zu indizieren ist nur Decision Knoten bei ES.

Auch, warum die einzige einzelne Entscheidung von ~ 60 indiziert ist? Ich denke "_id": "Null" an der Elasticsearch JSON-Ausgabe ist mit diesem Problem verbunden. Was mache ich falsch ?

Antwort

1

Es ist unsere Dokumentation scheint hat über die Verwendung des internen ID als Dokument-ID seltsam:

diese Zeile ersetzen: com.graphaware.module.UIDM.uuidProperty=ID()

Durch diese

com.graphaware.module.ES.keyProperty=ID()

Wenn Sie jedoch Verwenden Sie auch das UUID-Modul, verwenden Sie am besten "UUID" anstelle der internen ID

Ich habe auf Community 3.1.3 mit den genannten Versionen getestet und es funktioniert.

{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" :{ "_index" : "neo4j-index-node", "_type" : "Decision", "_id" : "2", "_score" : 1.0, "_source":{"id":123,"title":"Ibiza"} }, { "_index" : "neo4j-index-node", "_type" : "Decision", "_id" : "3", "_score" : 1.0, "_source":{"id":123,"title":"Weird Decision"} } ] } }

Wenn die Knoten sowohl Etiketten Entscheidung und Votable haben, dann müssen Sie sie in der Konfiguration wie folgt auszuschließen:

com.graphaware.module.ES.node=hasLabel('Decision') && !hasLabel('Votable') && !hasLabel('BaseEntity')

Verwandte Themen