Skip to content

Commit 9d2f0de

Browse files
committed
Add MapperFeature for yaml tests
1 parent 553a95d commit 9d2f0de

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

rest-api-spec/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ tasks.named("yamlRestCompatTestTransform").configure ({ task ->
110110
task.skipTest("logsdb/10_settings/override sort order settings", "we changed the error message")
111111
task.skipTest("tsdb/10_settings/set start_time and end_time without timeseries mode", "we don't validate for index_mode=tsdb when setting start_date/end_date anymore")
112112
task.skipTest("tsdb/10_settings/set start_time, end_time and routing_path via put settings api without time_series mode", "we don't validate for index_mode=tsdb when setting start_date/end_date anymore")
113+
task.skipTest("search/140_pre_filter_search_shards/prefilter on non-indexed date fields", "prefiltering can now use skippers on dv-only fields")
113114
// Expected deprecation warning to compat yaml tests:
114115
task.addAllowedWarningRegex("Use of the \\[max_size\\] rollover condition has been deprecated in favour of the \\[max_primary_shard_size\\] condition and will be removed in a later version")
115116
})

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ setup:
240240
---
241241
"prefilter on non-indexed date fields":
242242
- requires:
243-
cluster_features: "gte_v8.1.0"
244-
reason: "doc values search was added in 8.1.0"
243+
cluster_features: [ "gte_v8.1.0", "mapper.skippers_on_unindexed_fields" ]
244+
reason: "doc values search was added in 8.1.0; skippers allow pre-filtering"
245245

246246
- do:
247247
index:
@@ -274,7 +274,7 @@ setup:
274274
- match: { _shards.failed: 0 }
275275
- match: { hits.total: 2 }
276276

277-
# this is a case where we would normally skip due to rewrite but we can't because we only have doc values
277+
# this is a case where we can use docvalues skippers to pre-filter index_1
278278
- do:
279279
search:
280280
rest_total_hits_as_int: true
@@ -283,6 +283,6 @@ setup:
283283

284284
- match: { _shards.total: 3 }
285285
- match: { _shards.successful: 3 }
286-
- match: { _shards.skipped : 0 }
286+
- match: { _shards.skipped : 1 }
287287
- match: { _shards.failed: 0 }
288288
- match: { hits.total: 2 }

server/src/main/java/org/elasticsearch/index/mapper/MapperFeatures.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class MapperFeatures implements FeatureSpecification {
6464
public static final NodeFeature GENERIC_VECTOR_FORMAT = new NodeFeature("mapper.vectors.generic_vector_format");
6565
public static final NodeFeature FIX_DENSE_VECTOR_WRONG_FIELDS = new NodeFeature("mapper.fix_dense_vector_wrong_fields");
6666
static final NodeFeature BBQ_DISK_STATS_SUPPORT = new NodeFeature("mapper.bbq_disk_stats_support");
67+
static final NodeFeature SKIPPERS_ON_UNINDEXED_FIELDS = new NodeFeature("mapper.skippers_on_unindexed_fields");
6768

6869
@Override
6970
public Set<NodeFeature> getTestFeatures() {
@@ -108,7 +109,8 @@ public Set<NodeFeature> getTestFeatures() {
108109
EXCLUDE_VECTORS_DOCVALUE_BUGFIX,
109110
BASE64_DENSE_VECTORS,
110111
FIX_DENSE_VECTOR_WRONG_FIELDS,
111-
BBQ_DISK_STATS_SUPPORT
112+
BBQ_DISK_STATS_SUPPORT,
113+
SKIPPERS_ON_UNINDEXED_FIELDS
112114
);
113115
if (ES93GenericFlatVectorsFormat.GENERIC_VECTOR_FORMAT.isEnabled()) {
114116
features = new HashSet<>(features);

test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import org.elasticsearch.search.lookup.Source;
7575
import org.elasticsearch.search.lookup.SourceFilter;
7676
import org.elasticsearch.search.lookup.SourceProvider;
77+
import org.elasticsearch.test.index.IndexVersionUtils;
7778
import org.elasticsearch.xcontent.ToXContent;
7879
import org.elasticsearch.xcontent.XContentBuilder;
7980
import org.elasticsearch.xcontent.XContentFactory;

0 commit comments

Comments
 (0)