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

[Help] How to access document metadata? #183

Open
david-benes opened this issue Jun 4, 2020 · 1 comment
Open

[Help] How to access document metadata? #183

david-benes opened this issue Jun 4, 2020 · 1 comment

Comments

@david-benes
Copy link

david-benes commented Jun 4, 2020

I was able to setup import from postgress via abc import to ElasticSearch 7.7.
I would like to configure parent / child relationship so that I can use join queries. For this to work, http requests to Elastic must contain routing argument (requests with parent/child relationship without routing fails). This argument should contain a string that is always the same for all documents in a relation so that these documents can be stored in the same shard.

abc import does imports by sending _bulk requests to elastic. The first part of the _bulk item contains document metadata (_id, _type, ...) and the second part contains the actual document. Elastic alternatively accepts routing property in document metadata. What I haven't found is how can I access document metadata in transform function.

The transform function allows you to modify a document. Can I somehow access the document metadata and change it during import?

@david-benes david-benes changed the title How to access document metadata [Help] How to access document metadata? Jun 4, 2020
@david-benes
Copy link
Author

Alright, it seems to be impossible to modify document metadata. The only value that propagates from data to metadata is _id that will be deleted from data before inserting to Elastic.

br = elastic.NewBulkIndexRequest().Index(w.index).Type(indexType).Id(id).Doc(msg.Data())

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