{"action":"created","issue":{"url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/21","repository_url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch","labels_url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/21/comments","events_url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/21/events","html_url":"https://github.com/graphaware/neo4j-to-elasticsearch/pull/21","id":166610037,"number":21,"title":"New Mapping's classes","user":{"login":"alenegro81","id":2557275,"avatar_url":"https://avatars.githubusercontent.com/u/2557275?v=3","gravatar_id":"","url":"https://api.github.com/users/alenegro81","html_url":"https://github.com/alenegro81","followers_url":"https://api.github.com/users/alenegro81/followers","following_url":"https://api.github.com/users/alenegro81/following{/other_user}","gists_url":"https://api.github.com/users/alenegro81/gists{/gist_id}","starred_url":"https://api.github.com/users/alenegro81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenegro81/subscriptions","organizations_url":"https://api.github.com/users/alenegro81/orgs","repos_url":"https://api.github.com/users/alenegro81/repos","events_url":"https://api.github.com/users/alenegro81/events{/privacy}","received_events_url":"https://api.github.com/users/alenegro81/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-20T15:26:48Z","updated_at":"2016-07-26T15:36:25Z","closed_at":"2016-07-26T08:03:53Z","pull_request":{"url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/pulls/21","html_url":"https://github.com/graphaware/neo4j-to-elasticsearch/pull/21","diff_url":"https://github.com/graphaware/neo4j-to-elasticsearch/pull/21.diff","patch_url":"https://github.com/graphaware/neo4j-to-elasticsearch/pull/21.patch"},"body":"The current pull request fixes some issues (8, 11, 12, 14, 15, 20) creating some new Mapping classes and updating old DefaultMapping. In particular:\r\n\r\n1. DefaultMapping is changed to support array properties in nodes and relationships. All the available property array types are now supported a part from char and byte that are not created in the right way in the json. \r\n2. SimpleMapping is created for compatibility, it is the has the same behavior as old DefaultMapping\r\n3. AdvancedMapping use a complete different approach in creating documents. All nodes and relationships are created in the same type (node for nodes, relationship for relationships). Labels are stored as field _labels, while relationship type is stored as _relationship. \r\n\r\nIn the AdvancedMapping it is necessary to take care of the properties created on nodes since all of them belong to the same type each property need to have the same value on all the nodes, otherwise it could cause issue in the insertion on the es.\r\n\r\nThis PR should solve the great part of the current issue on the plugin\r\n\r\n---\r\n\r\nThere is now another mapping possibility like explained in the comments to @johnbodley , the `JsonFileMapping`.\r\n\r\nA now working example is : \r\n\r\n```json\r\n{\r\n  \"defaults\": {\r\n    \"key_property\": \"uuid\",\r\n    \"nodes_index\": \"node-index\",\r\n    \"relationships_index\": \"relationship-index\",\r\n    \"include_remaining_properties\": true,\r\n    \"blacklisted_node_properties\": [\"password\", \"uuid\"]\r\n  },\r\n  \"node_mappings\": [\r\n    {\r\n      \"condition\": \"hasLabel('Person')\",\r\n      \"type\": \"persons\",\r\n      \"properties\": {\r\n        \"name\": \"getProperty('firstName') + ' ' + getProperty('lastName')\",\r\n        \"labels\": \"getLabels()\"\r\n      }\r\n    },\r\n    {\r\n      \"condition\": \"hasLabel('Female')\",\r\n      \"index\": \"females\",\r\n      \"type\": \"girls\",\r\n      \"properties\": {\r\n        \"name\": \"getProperty('firstName')\"\r\n      }\r\n    },\r\n    {\r\n      \"condition\": \"getLabels().length == 0\",\r\n      \"type\": \"nodes-without-labels\"\r\n    },\r\n    {\r\n      \"condition\": \"hasLabel('Node')\",\r\n      \"type\": \"nodes\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n```\r\n{\"_index\":\"females\",\"_type\":\"girls\",\"_id\":\"ee42cef0-4ee2-11e6-ad60-5a636a648dcc\",\"_version\":1,\"found\":true,\"_source\":{\"firstName\":\"Daniela\",\"lastName\":\"Daniela\",\"name\":\"Daniela\",\"uuid\":\"ee42cef0-4ee2-11e6-ad60-5a636a648dcc\"}}\r\n{\"_index\":\"node-index\",\"_type\":\"persons\",\"_id\":\"ee1640b0-4ee2-11e6-ad60-5a636a648dcc\",\"_version\":1,\"found\":true,\"_source\":{\"firstName\":\"Michal\",\"lastName\":\"Bachman\",\"name\":\"Michal Bachman\",\"uuid\":\"ee1640b0-4ee2-11e6-ad60-5a636a648dcc\",\"age\":30,\"labels\":[\"Person\",\"Male\"]}}\r\n{\"_index\":\"node-index\",\"_type\":\"persons\",\"_id\":\"ee1e5700-4ee2-11e6-ad60-5a636a648dcc\",\"_version\":1,\"found\":true,\"_source\":{\"firstName\":\"Adam\",\"lastName\":\"George\",\"name\":\"Adam George\",\"uuid\":\"ee1e5700-4ee2-11e6-ad60-5a636a648dcc\",\"labels\":[\"Person\",\"Male\"]}}\r\n{\"_index\":\"node-index\",\"_type\":\"persons\",\"_id\":\"ee42cef0-4ee2-11e6-ad60-5a636a648dcc\",\"_version\":1,\"found\":true,\"_source\":{\"firstName\":\"Daniela\",\"lastName\":\"Daniela\",\"name\":\"Daniela Daniela\",\"uuid\":\"ee42cef0-4ee2-11e6-ad60-5a636a648dcc\",\"labels\":[\"Person\",\"Female\"]}}\r\n```\r\n\r\nIt has support for `array` types, nodes without labels, concatenation and more logic available via Spring Expression Language.\r\n\r\nBreaking change: the type of the mapping should now be the fully qualified class name of the mapping class."},"comment":{"url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/comments/235307495","html_url":"https://github.com/graphaware/neo4j-to-elasticsearch/pull/21#issuecomment-235307495","issue_url":"https://api.github.com/repos/graphaware/neo4j-to-elasticsearch/issues/21","id":235307495,"user":{"login":"ikwattro","id":1222009,"avatar_url":"https://avatars.githubusercontent.com/u/1222009?v=3","gravatar_id":"","url":"https://api.github.com/users/ikwattro","html_url":"https://github.com/ikwattro","followers_url":"https://api.github.com/users/ikwattro/followers","following_url":"https://api.github.com/users/ikwattro/following{/other_user}","gists_url":"https://api.github.com/users/ikwattro/gists{/gist_id}","starred_url":"https://api.github.com/users/ikwattro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikwattro/subscriptions","organizations_url":"https://api.github.com/users/ikwattro/orgs","repos_url":"https://api.github.com/users/ikwattro/repos","events_url":"https://api.github.com/users/ikwattro/events{/privacy}","received_events_url":"https://api.github.com/users/ikwattro/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T15:36:25Z","updated_at":"2016-07-26T15:36:25Z","body":"@johnbodley I can send you a jar if you want one. We plan to release this evening or tomorrow."}}
{"actor":{"display_login":"ikwattro"}}