2017-04-18 13 views
1

私はNeo4jアプリケーションをElasticsearchと統合します。私はGraphAwareから次のNeo4jプラグインを試してみるつもりですhttps://github.com/graphaware/neo4j-to-elasticsearchNeo4j 3.1.3とElasticsearchの統合

Neo4j 3.1.3のバージョンをサポートしてくれませんか?また、そこにはどのバージョンのESを使うべきですか?それは例えばES 5.3.0をサポートしていますか?

今、私はElasticsearch 5.3.0をローカルにインストールしました。私Neo4j CE 3.1.3\plugins\フォルダに

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

:また、私は2つのjarを追加しました。

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

しかし、私は何も起こりません春データのNeo4jプロジェクトを介してデータを挿入しています:

はまた、私はライン私のデータベース構成(Neo4j Community Edition\neo4j.conf)に(https://github.com/neo4j-contrib/neo4j-elasticsearch#exampleがここdescrbedとして)以下の設定を追加しています。 Elasticsearchインデックスはまだ空です。

私は間違って何をやっているのですか?これは私の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 

私は実体を持っている:

は、私はこの上でいくつかの進歩を遂げ

を更新しましたDecision。今、私は私のNeo4jデータベースへ〜60個の意思決定ノードを追加しているが、私はESでそれらのすべてを見ることができないんだ

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

Decisionは大きな親階層を持つ複合型です。私は階層内の親クラスごとに重複がある最初のものだけを見ることができます。

この私が今持っているもの:

$ 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" 
     } 
    } ] 
    } 
} 

VotableLikeableなど)意思決定のサブクラスのすべては、そこに複製されているのはなぜ?私の目標は、インデックスにESでのみDecisionノードである

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

:あなたは私の設定から見ることができるように私は除いてすべてを排除しようとしています。

また、なぜ〜60からの唯一の決定がインデックスに登録されていますか?私は "_id"と思う:Elasticsearchでの "null" JSON出力はこの問題に関連している。私は間違って何をしていますか?

答えて

1

私たちのドキュメントはドキュメントIDとして内部IDの使用状況についての奇妙されているようだ:

この行に置き換え:あなたの場合は、この

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

では com.graphaware.module.UIDM.uuidProperty=ID()

をuuidモジュールも使用してください。内部IDの代わりに「uuid」を使用することをお勧めします

コミュニティ3.1.3で上記のバージョンでテストしたところ、動作しています。

{ "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"} } ] } }

あなたのノードは、ラベルの意思決定とVotableの両方を持っている場合は、あなたがこのような構成では、それらを除外することがあります。

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

関連する問題