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

Elasticsearch - Ids of nested edges and vertices #136

Open
andreyxebialabs opened this issue Jan 13, 2019 · 0 comments
Open

Elasticsearch - Ids of nested edges and vertices #136

andreyxebialabs opened this issue Jan 13, 2019 · 0 comments

Comments

@andreyxebialabs
Copy link

There is support for nested edges and nested vertices. But it requires some field to explicitly be id. Document's _id field is not accessible from nested context and anyway does not work. Specifying non-unique ids lead to weird behavior (seems, that documents having same id collide and only one survive).

How can we solve that?

I'd expect ids of nested relations to be generated from document _id plus some suffix, which can include either nested document index or some of nested document fields. So, if my document has _id = 'asdf', then subdoc may have something like 'asdf-relations[0]' or 'asdf-relations[myRelationType-myOtherNode]'

Examples:

Unipop Elastic mapping:

{
"class": "org.unipop.elastic.ElasticSourceProvider",
"addresses": "http://localhost:9200",
"vertices": [
{
"index": "nodes",
"id": "@_id",
"label": "node",
"properties": {
},
"edges": [
{
"index": "nodes",
"path": "relations",
"id": "@relatedNodeId", // this is not unique
"label": "relation",
"direction": "OUT",
"properties": {
},
"vertex":{
"ref": true,
"id": "@relatedNodeId",
"label": "node"
}
}
]
}
]
}

Document:

"_source": {
"relations": [
{
"relationType": "myRelationType",
"relatedNodeId": "myOtherNode"
}
]
}

Thank you.

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

1 participant