|
19 | 19 | import org.apache.lucene.search.suggest.document.RegexCompletionQuery; |
20 | 20 | import org.apache.lucene.search.suggest.document.SuggestField; |
21 | 21 | import org.elasticsearch.common.ParsingException; |
22 | | -import org.elasticsearch.common.logging.DeprecationCategory; |
23 | 22 | import org.elasticsearch.common.logging.DeprecationLogger; |
24 | 23 | import org.elasticsearch.common.unit.Fuzziness; |
25 | 24 | import org.elasticsearch.common.util.Maps; |
26 | 25 | import org.elasticsearch.index.IndexVersion; |
27 | | -import org.elasticsearch.index.IndexVersions; |
28 | 26 | import org.elasticsearch.index.analysis.AnalyzerScope; |
29 | 27 | import org.elasticsearch.index.analysis.NamedAnalyzer; |
30 | 28 | import org.elasticsearch.index.query.SearchExecutionContext; |
@@ -213,29 +211,11 @@ public CompletionFieldMapper build(MapperBuilderContext context) { |
213 | 211 |
|
214 | 212 | private void checkCompletionContextsLimit() { |
215 | 213 | if (this.contexts.getValue() != null && this.contexts.getValue().size() > COMPLETION_CONTEXTS_LIMIT) { |
216 | | - if (indexVersionCreated.onOrAfter(IndexVersions.V_8_0_0)) { |
217 | | - throw new IllegalArgumentException( |
218 | | - "Limit of completion field contexts [" + COMPLETION_CONTEXTS_LIMIT + "] has been exceeded" |
219 | | - ); |
220 | | - } else { |
221 | | - deprecationLogger.warn( |
222 | | - DeprecationCategory.MAPPINGS, |
223 | | - "excessive_completion_contexts", |
224 | | - "You have defined more than [" |
225 | | - + COMPLETION_CONTEXTS_LIMIT |
226 | | - + "] completion contexts" |
227 | | - + " in the mapping for field [" |
228 | | - + leafName() |
229 | | - + "]. " |
230 | | - + "The maximum allowed number of completion contexts in a mapping will be limited to " |
231 | | - + "[" |
232 | | - + COMPLETION_CONTEXTS_LIMIT |
233 | | - + "] starting in version [8.0]." |
234 | | - ); |
235 | | - } |
| 214 | + throw new IllegalArgumentException( |
| 215 | + "Limit of completion field contexts [" + COMPLETION_CONTEXTS_LIMIT + "] has been exceeded" |
| 216 | + ); |
236 | 217 | } |
237 | 218 | } |
238 | | - |
239 | 219 | } |
240 | 220 |
|
241 | 221 | public static final Set<String> ALLOWED_CONTENT_FIELD_NAMES = Set.of( |
|
0 commit comments