Skip to content

Commit 231fd4e

Browse files
author
Christoph Büscher
authored
Remove delimited_payload_filter (#27705)
From 7.0 on, using `delimited_payload_filter` should throw an error. It was deprecated in 6.2 in favour of `delimited_payload` (#26625). Relates to #27704
1 parent fb1aba9 commit 231fd4e

File tree

3 files changed

+17
-30
lines changed

3 files changed

+17
-30
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
[[breaking_70_analysis_changes]]
22
=== Analysis changes
33

4-
==== The `delimited_payload_filter` is renamed
5-
6-
The `delimited_payload_filter` is renamed to `delimited_payload`, the old name is
7-
deprecated and will be removed at some point, so it should be replaced by
8-
`delimited_payload`.
9-
10-
114
==== Limiting the number of tokens produced by _analyze
125

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

17-
1810
==== Limiting the length of an analyzed text during highlighting
1911

2012
Highlighting a text that was indexed without offsets or term vectors,
2113
requires analysis of this text in memory real time during the search request.
2214
For large texts this analysis may take substantial amount of time and memory.
2315
To protect against this, the maximum number of characters that will be analyzed has been
2416
limited to 1000000. This default limit can be changed
25-
for a particular index with the index setting `index.highlight.max_analyzed_offset`.
17+
for a particular index with the index setting `index.highlight.max_analyzed_offset`.
18+
19+
==== `delimited_payload_filter` renaming
20+
21+
The `delimited_payload_filter` was deprecated and renamed to `delimited_payload` in 6.2.
22+
Using it in indices created before 7.0 will issue deprecation warnings. Using the old
23+
name in new indices created in 7.0 will throw an error. Use the new name `delimited_payload`
24+
instead.

modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/LegacyDelimitedPayloadTokenFilterFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTo
3232

3333
LegacyDelimitedPayloadTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
3434
super(indexSettings, env, name, settings);
35+
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0_alpha1)) {
36+
throw new IllegalArgumentException(
37+
"[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead");
38+
}
3539
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) {
3640
DEPRECATION_LOGGER.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]");
3741
}

modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/40_token_filters.yml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,15 +1026,13 @@
10261026
- match: { tokens.10.token: ちた }
10271027

10281028
---
1029-
"delimited_payload_filter":
1029+
"delimited_payload_filter_error":
10301030
- skip:
1031-
version: " - 6.1.99"
1032-
reason: delimited_payload_filter deprecated in 6.2, replaced by delimited_payload
1033-
features: "warnings"
1031+
version: " - 6.99.99"
1032+
reason: using delimited_payload_filter throws error from 7.0 on
10341033

10351034
- do:
1036-
warnings:
1037-
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
1035+
catch: /\[delimited_payload_filter\] is not supported for new indices, use \[delimited_payload\] instead/
10381036
indices.create:
10391037
index: test
10401038
body:
@@ -1045,29 +1043,15 @@
10451043
type: delimited_payload_filter
10461044
delimiter: ^
10471045
encoding: identity
1048-
- do:
1049-
warnings:
1050-
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
1051-
indices.analyze:
1052-
index: test
1053-
body:
1054-
text: foo^bar
1055-
tokenizer: keyword
1056-
filter: [my_delimited_payload_filter]
1057-
- length: { tokens: 1 }
1058-
- match: { tokens.0.token: foo }
10591046

10601047
# Test pre-configured token filter too:
10611048
- do:
1062-
warnings:
1063-
- "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"
1049+
catch: /\[delimited_payload_filter\] is not supported for new indices, use \[delimited_payload\] instead/
10641050
indices.analyze:
10651051
body:
10661052
text: foo|5
10671053
tokenizer: keyword
10681054
filter: [delimited_payload_filter]
1069-
- length: { tokens: 1 }
1070-
- match: { tokens.0.token: foo }
10711055

10721056
---
10731057
"delimited_payload":

0 commit comments

Comments
 (0)