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

Ability to explicitly pass an index/type for a document through it metadata #991

Closed
ov7a opened this issue May 16, 2017 · 3 comments
Closed

Comments

@ov7a
Copy link

ov7a commented May 16, 2017

Feature description

Start of discussion: #990 (comment)

Currently, if one wants to use complex logic for getting index name for document, there are two options:

  1. Use patterns to construct an index name
  2. Implement index name as part of transformation steps before persisting to Elasticsearch and add extra field to resulting document.

If logic is very complex then the first option is either to hard or impossible to implement. With the second option, extra field can be eliminated with es.mapping.exclude feature.

Unfortunately, es.mapping.exclude feature is ignored when es.input.json is specified. So, currently it is impossible to use complex logic, json input and have no extra fields in mapping.

I propose to add an INDEX option to document metadata to provide an explicit index for document.

Same thoughts can be applied to type of a document.

@jbaiera
Copy link
Member

jbaiera commented Jun 8, 2017

Related (loosely) to #956

@whitfin
Copy link

whitfin commented Jun 17, 2017

To work around es.mapping.exclude, I believe you can exclude the fields in your index mapping in ES itself. Wasted bytes on the wire, but at least it won't be persisted.

@jbaiera
Copy link
Member

jbaiera commented Mar 19, 2018

I'm closing this feature request out because it is not really an item that anyone will be working on and conflicts with a few features in the ES-Hadoop connector - primarily the feature of a writer "pinning" itself to a primary node - In the event that an index pattern is specified, we allow writers to pin to any node they want. This mode works with the "save with metadata" feature. The problem is that the moment you allow "save with metadata" to provide an index or type during runtime, we need to turn off the selective host targeting for any use of "save with metadata".

Adding more configurations to get around this feels clunky for a feature that is already supported with existing fields and configurations. If more control over the serialization is needed, we provide it already with es.mapping.exclude. While this indeed does not work with raw json data, the idea for writing raw json is to avoid the overhead of serialization logic in the connector.

If this gets enough push from the community, we can discuss a way forward, but for now I am closing this.

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

No branches or pull requests

3 participants