neo4j-elasticsearch icon indicating copy to clipboard operation
neo4j-elasticsearch copied to clipboard

merge properties from multiple neo4j nodes into one elasticsearch document possible?

Open bbernhard opened this issue 9 years ago • 5 comments

Hi,

thanks for all the great work! I just tried neo4j-elasticsearch with the example provided in the documentation. That worked out of the box, without any problems. ;) Now I would like to do something more advaned with neo4j-elasticsearch and I am not really sure if that's possible.

I have the following neo4j schema User-[WORKS_AT]->Location and I would like to merge properties from both the User node and the Location node together into one elasticsearch document.

Is that somehow possible?

Greetings from Austria, Bernhard

bbernhard avatar Oct 08 '16 12:10 bbernhard

One option is just to take the source and adapt it to your needs. I think generalizing this, might be a bit of a stretch.

Then we would have to allow an additional config that creates derived properties out of a cypher query. While it would be possible, and neat. I don't have the bandwidth right now to implement it.

Something like this:

elasticsearch.project_User=WITH _ as user MATCH (user)-[:WORKS_AT]->(l) RETURN user.name as name, location.address as address

would then store name and address properties in the ES index.

elasticsearch.project_User=WITH _ as user MATCH (user)-[:WORKS_AT]->(l) RETURN {name:user.name, loc:location.address} as info

would then store an info property in ES

jexp avatar Oct 09 '16 02:10 jexp

Hi,

Is possible to index the nodes which satisfies some conditions.

for example: user:USER(id) where user.id="Santosh"

santosh-hegde avatar Nov 18 '16 08:11 santosh-hegde

You could use the elasticsearch integreation of https://github.com/neo4j-contrib/neo4j-apoc-procedures to achieve that kind of one-off indexing, e.g. combined with the triggers there.

Here it would add a lot of complexity as you would have to define the filter-queries which are then run on every update.

Michael

On Fri, Nov 18, 2016 at 9:55 AM, santosh-hegde [email protected] wrote:

Hi,

Is possible to index the nodes which satisfies some conditions.

for example: user:USER(id) where user.id="Santosh"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neo4j-contrib/neo4j-elasticsearch/issues/25#issuecomment-261480361, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEHY_Zf2YerIf0nLwhmSGcKqJBfxBCfks5q_WgZgaJpZM4KRteG .

jexp avatar Nov 19 '16 12:11 jexp

Would the apoc approach work for you @santosh-hegde ?

jexp avatar Dec 20 '16 20:12 jexp

Hi Michael,

I didn't try executing APOC Procedure. But elasticsearch.project_User=WITH _ as user MATCH (user)-[:WORKS_AT]->(l) RETURN {name:user.name, loc:location.address} as info is not working to me.

santosh-hegde avatar Jan 02 '17 08:01 santosh-hegde