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

Raw fields should be considered as text/keyword #526

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

dadoonet
Copy link
Owner

As elasticsearch will by default to automatically guess the type, you could end up having conflicts between
metadata raw fields: a field which is first detected as a date but is getting for another document a value like
"in the seventies". In such a case, you could imagine forcing the mapping or defining an index mapping template.

This commit provides now a dynamic template for meta.raw.* fields:

      "dynamic_templates": [
        {
          "raw_as_text": {
            "path_match": "meta.raw.*",
            "mapping": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ],

Closes #439.

@dadoonet dadoonet added the bug For confirmed bugs label Feb 22, 2018
@dadoonet dadoonet added this to the 2.5 milestone Feb 22, 2018
@dadoonet dadoonet self-assigned this Feb 22, 2018
As elasticsearch will by default to automatically guess the type, you could end up having conflicts between
metadata raw fields: a field which is first detected as a date but is getting for another document a value like
"in the seventies". In such a case, you could imagine forcing the mapping or defining an index mapping template.

This commit provides now a dynamic template for `meta.raw.*` fields:

```
      "dynamic_templates": [
        {
          "raw_as_text": {
            "path_match": "meta.raw.*",
            "mapping": {
              "type": "text",
              "fields": {
                "keyword": {
                  "type": "keyword",
                  "ignore_above": 256
                }
              }
            }
          }
        }
      ],
```

It adds more tests about the `raw` field option.

Closes #439.
@dadoonet dadoonet force-pushed the fix/439-raw-mapping branch from 145ce4c to c1b010e Compare February 23, 2018 14:21
@dadoonet dadoonet merged commit d355d73 into master Feb 23, 2018
@dadoonet dadoonet deleted the fix/439-raw-mapping branch February 23, 2018 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For confirmed bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant