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

Remove delimited_payload_filter #27705

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions docs/reference/migration/migrate_7_0/analysis.asciidoc
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[[breaking_70_analysis_changes]]
=== Analysis changes

==== The `delimited_payload_filter` is renamed

The `delimited_payload_filter` is renamed to `delimited_payload`, the old name is
deprecated and will be removed at some point, so it should be replaced by
`delimited_payload`.


==== Limiting the number of tokens produced by _analyze

To safeguard against out of memory errors, the number of tokens that can be produced
using the `_analyze` endpoint has been limited to 10000. This default limit can be changed
for a particular index with the index setting `index.analyze.max_token_count`.


==== Limiting the length of an analyzed text during highlighting

Highlighting a text that was indexed without offsets or term vectors,
requires analysis of this text in memory real time during the search request.
For large texts this analysis may take substantial amount of time and memory.
To protect against this, the maximum number of characters that will be analyzed has been
limited to 1000000. This default limit can be changed
for a particular index with the index setting `index.highlight.max_analyzed_offset`.
for a particular index with the index setting `index.highlight.max_analyzed_offset`.

==== `delimited_payload_filter` renaming

The `delimited_payload_filter` was deprecated and renamed to `delimited_payload` in 6.2.
Using it in indices created before 7.0 will issue deprecation warnings. Using the old
name in new indices created in 7.0 will throw an error. Use the new name `delimited_payload`
instead.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTo

LegacyDelimitedPayloadTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
super(indexSettings, env, name, settings);
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0_alpha1)) {
throw new IllegalArgumentException(
"[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead");
}
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) {
DEPRECATION_LOGGER.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,15 +1026,13 @@
- match: { tokens.10.token: ちた }

---
"delimited_payload_filter":
"delimited_payload_filter_error":
- skip:
version: " - 6.1.99"
reason: delimited_payload_filter deprecated in 6.2, replaced by delimited_payload
features: "warnings"
version: " - 6.99.99"
reason: using delimited_payload_filter throws error from 7.0 on

- do:
warnings:
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
catch: /\[delimited_payload_filter\] is not supported for new indices, use \[delimited_payload\] instead/
indices.create:
index: test
body:
Expand All @@ -1045,29 +1043,15 @@
type: delimited_payload_filter
delimiter: ^
encoding: identity
- do:
warnings:
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
indices.analyze:
index: test
body:
text: foo^bar
tokenizer: keyword
filter: [my_delimited_payload_filter]
- length: { tokens: 1 }
- match: { tokens.0.token: foo }

# Test pre-configured token filter too:
- do:
warnings:
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
catch: /\[delimited_payload_filter\] is not supported for new indices, use \[delimited_payload\] instead/
indices.analyze:
body:
text: foo|5
tokenizer: keyword
filter: [delimited_payload_filter]
- length: { tokens: 1 }
- match: { tokens.0.token: foo }

---
"delimited_payload":
Expand Down