Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bbernhard opened this issue Oct 8, 2016 · 5 comments

Comments

@bbernhard
Copy link

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

@jexp
Copy link
Member

jexp commented Oct 9, 2016

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

@santosh-hegde
Copy link

Hi,

Is possible to index the nodes which satisfies some conditions.

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

@jexp
Copy link
Member

jexp commented Nov 19, 2016

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
#25 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEHY_Zf2YerIf0nLwhmSGcKqJBfxBCfks5q_WgZgaJpZM4KRteG
.

@jexp
Copy link
Member

jexp commented Dec 20, 2016

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

@santosh-hegde
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants