I'm using the neo4j batch operations endpoint.
I want to index properties to an existing node if they have not been indexed before, ie. I'm using this endpoint, with the exception of using ?uniqueness=get_or_create
flag.
It works, when when I'm issuing two such batch requests in a row for two different nodes, the second one never gets indexed!
Here is the payload for the the two batch requests:
FIRST ONE:
[
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'registeredInShop',
value: '52a5f4e19e3fc8406a000006'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'idInShop',
value: '1'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'email',
value: 'me@shop.com'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'createdOn',
value: 1386607841880
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSpam',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isHardBounced',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSubscribedAlerts',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isSubscribed',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'attributes_isCustomer',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2388',
key: 'id',
value: '52a5f4e19e3fc8406a000008'
}
}
]
// SECOND ONE
[
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'registeredInShop',
value: '52a5f4e19e3fc8406a000006'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'email',
value: 'me2@shop.com'
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'createdOn',
value: 1386607842460
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSpam',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isHardBounced',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSubscribedAlerts',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isSubscribed',
value: true
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'attributes_isCustomer',
value: false
}
},
{
method: 'POST',
to: '/index/node/users?uniqueness=get_or_create',
body: {
uri: 'http: //localhost: 7474/db/data/node/2390',
key: 'id',
value: '52a5f4e29e3fc8406a000016'
}
}
]
Any ideea as to why this is happening? If I remove uniqueness=get_or_create
it works, but it's exactly what I want to achieve!