-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Store raw pattern text fields in binary doc values #140191
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
40dacf0
Use stored fallback fields when time series doc values format is not …
Kubik42 1440ce0
testing
Kubik42 80bf847
Migrate TextRollingUpgradeIT to run in serverless
Kubik42 910d021
Store fallback text fields in binary doc values
Kubik42 90f6c2c
Store fallback match only text fields in binary doc values
Kubik42 254278d
Use binary doc values instead of stored fields for pattern text
Kubik42 889eb79
Renamed usesBinaryDocValues to be more clear what its used for
Kubik42 56d60ca
Use simple BinaryDocValues
Kubik42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
...ade/src/javaRestTest/java/org/elasticsearch/xpack/logsdb/PatternTextRollingUpgradeIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.xpack.logsdb; | ||
|
|
||
| import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; | ||
|
|
||
| import java.util.Arrays; | ||
|
|
||
| public class PatternTextRollingUpgradeIT extends AbstractStringTypeLogsdbRollingUpgradeTestCase { | ||
|
|
||
| private static final String MIN_VERSION = "gte_v9.2.0"; | ||
| private static final String DATA_STREAM_NAME_PREFIX = "logs-pattern-text-bwc-test"; | ||
|
|
||
| private static final String TEMPLATE = """ | ||
| { | ||
| "mappings": { | ||
| "properties": { | ||
| "@timestamp" : { | ||
| "type": "date" | ||
| }, | ||
| "length": { | ||
| "type": "long" | ||
| }, | ||
| "factor": { | ||
| "type": "double" | ||
| }, | ||
| "message": { | ||
| "type": "pattern_text" | ||
| } | ||
| } | ||
| } | ||
| }"""; | ||
|
|
||
| private static final String TEMPLATE_WITH_MULTI_FIELD = """ | ||
| { | ||
| "mappings": { | ||
| "properties": { | ||
| "@timestamp" : { | ||
| "type": "date" | ||
| }, | ||
| "length": { | ||
| "type": "long" | ||
| }, | ||
| "factor": { | ||
| "type": "double" | ||
| }, | ||
| "message": { | ||
| "type": "pattern_text", | ||
| "fields": { | ||
| "kwd": { | ||
| "type": "keyword" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }"""; | ||
|
|
||
| private static final String TEMPLATE_WITH_MULTI_FIELD_AND_IGNORE_ABOVE = """ | ||
| { | ||
| "mappings": { | ||
| "properties": { | ||
| "@timestamp" : { | ||
| "type": "date" | ||
| }, | ||
| "length": { | ||
| "type": "long" | ||
| }, | ||
| "factor": { | ||
| "type": "double" | ||
| }, | ||
| "message": { | ||
| "type": "pattern_text", | ||
| "fields": { | ||
| "kwd": { | ||
| "type": "keyword", | ||
| "ignore_above": 50 | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }"""; | ||
|
|
||
| public PatternTextRollingUpgradeIT(String template, String testScenario) { | ||
| super(DATA_STREAM_NAME_PREFIX + "." + testScenario, template); | ||
| } | ||
|
|
||
| @ParametersFactory | ||
| public static Iterable<Object[]> data() { | ||
| return Arrays.asList( | ||
| new Object[][] { | ||
| { TEMPLATE, "basic" }, | ||
| { TEMPLATE_WITH_MULTI_FIELD, "with-keyword-multi-field" }, | ||
| { TEMPLATE_WITH_MULTI_FIELD_AND_IGNORE_ABOVE, "with-keyword-multi-field-and-ignore-above" } } | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| protected void checkRequiredFeatures() { | ||
| assumeTrue("pattern_text only available from 9.2.0 onward", oldClusterHasFeature(MIN_VERSION)); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
gte_v9.3.0? But maybe we should use a cluster feature instead?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the same version as in the existing rolling upgrade test.
Would cluster feature make a big difference? The feature check is the same function call for both version and specific feature isn't it?