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

Change mapping of index-pattern fields to text #9353

Merged
merged 6 commits into from
Dec 7, 2016

Conversation

lukasolson
Copy link
Member

Fixes #9352.

This simply changes the type of all JSON fields in the index-pattern mapping from keyword to text. This change is because we don't want to treat these fields as keyword fields, because they can store lots and lots of information, and if they're stored as a single term, they will easily pass the limit of 32766 characters, and will cause errors when you try to save them.

@ycombinator
Copy link
Contributor

ycombinator commented Dec 3, 2016

I wonder if, for the same reason, we should also change the mapping of other index-pattern fields as well as various saved object fields from keyword to text. Specifically, I'm thinking of these fields which were made keyword in #9280 but whose values could get really long:

Thoughts, @lukasolson?

@lukasolson
Copy link
Member Author

@ycombinator I agree. I've updated the PR with these changes. Could you take another look?

@ycombinator
Copy link
Contributor

ycombinator commented Dec 7, 2016

@lukasolson Looks like you missed one:

searchSourceJSON: https://github.com/elastic/kibana/pull/9280/files#diff-81e6169673307c3525e30b9b697fb43bL90

Just kidding. I just noticed f107e96 👅

@ycombinator
Copy link
Contributor

@lukasolson A test needs to be updated:

context('when type is json', function () {

@@ -147,7 +147,7 @@ export default function SavedObjectFactory(es, kbnIndex, Promise, Private, Notif
properties: {
// setup the searchSource mapping, even if it is not used but this type yet
searchSourceJSON: {
type: 'keyword'
type: 'string'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be text?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GAH sorry

@ycombinator
Copy link
Contributor

LGTM.

@tsullivan
Copy link
Member

Does this fix being able to create an index pattern for a Metricbeat index?

@ycombinator
Copy link
Contributor

@tsullivan Yes it should, assuming you were running into an error like this:

{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[nij2QMp][127.0.0.1:9300][indices:data/write/index[p]]"}],"type":"illegal_argument_exception","reason":"Document contains at least one immense term in field=\"fields\" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped.  Please correct the analyzer to not produce such terms.  The prefix of the first immense term is: '[91, 123, 34, 110, 97, 109, 101, 34, 58, 34, 114, 101, 100, 105, 115, 46, 105, 110, 102, 111, 46, 99, 108, 117, 115, 116, 101, 114, 46, 101]...', original message: bytes can be at most 32766 in length; got 106706","caused_by":{"type":"max_bytes_length_exceeded_exception","reason":"bytes can be at most 32766 in length; got 106706"}},"status":400}

You will, of course, need to DELETE .kibana first.

@tsullivan
Copy link
Member

@ycombinator awesome - I confirmed this also fixes index patterns for twitter data 🐔

@tsullivan
Copy link
Member

Code changes LGTM but I wouldn't know if there are any other areas that need to be touched.

@lukasolson lukasolson merged commit 0a577f1 into elastic:master Dec 7, 2016
@lukasolson lukasolson deleted the fix/index-pattern-mapping branch March 27, 2018 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants