Skip to content

Commit 3b75e6c

Browse files
committed
Fixes
1 parent d34a52a commit 3b75e6c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

docs/changelog/134582.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 134582
2+
summary: Fixed match only text block loader not working when a keyword multi field
3+
is present
4+
area: Mapping
5+
type: bug
6+
issues: []

modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldTypeTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public void test_block_loader_uses_stored_fields_for_loading_when_synthetic_sour
243243

244244
// then
245245
// verify that we delegate block loading to the synthetic source delegate
246-
assertTrue(blockLoader instanceof MatchOnlyTextFieldType.BytesFromMixedStringsBytesRefBlockLoader);
246+
assertThat(blockLoader, Matchers.instanceOf(MatchOnlyTextFieldType.BytesFromMixedStringsBytesRefBlockLoader.class));
247247
}
248248

249249
public void test_block_loader_uses_synthetic_source_delegate_when_ignore_above_is_not_set() {
@@ -271,7 +271,7 @@ public void test_block_loader_uses_synthetic_source_delegate_when_ignore_above_i
271271

272272
// then
273273
// verify that we delegate block loading to the synthetic source delegate
274-
assertTrue(blockLoader instanceof BlockLoader.Delegating);
274+
assertThat(blockLoader, Matchers.instanceOf(BlockLoader.Delegating.class));
275275
}
276276

277277
public void test_block_loader_does_not_use_synthetic_source_delegate_when_ignore_above_is_set() {
@@ -319,7 +319,7 @@ public void test_block_loader_does_not_use_synthetic_source_delegate_when_ignore
319319

320320
// then
321321
// verify that we don't delegate anything
322-
assertFalse(blockLoader instanceof BlockLoader.Delegating);
322+
assertThat(blockLoader, Matchers.not(Matchers.instanceOf(BlockLoader.Delegating.class)));
323323
}
324324

325325
public void test_block_loader_does_not_use_synthetic_source_delegate_when_ignore_above_is_set_at_index_level() {
@@ -367,6 +367,6 @@ public void test_block_loader_does_not_use_synthetic_source_delegate_when_ignore
367367

368368
// then
369369
// verify that we don't delegate anything
370-
assertFalse(blockLoader instanceof BlockLoader.Delegating);
370+
assertThat(blockLoader, Matchers.not(Matchers.instanceOf(BlockLoader.Delegating.class)));
371371
}
372372
}

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patterntext/PatternTextFieldType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class PatternTextFieldType extends TextFamilyFieldType {
7575
boolean isSyntheticSource,
7676
boolean isWithinMultiField
7777
) {
78-
// Though this type is based on doc_values, hasDocValues is set to false as the patterned_text type is not aggregatable.
78+
// Though this type is based on doc_values, hasDocValues is set to false as the pattern_text type is not aggregatable.
7979
// This does not stop its child .template type from being aggregatable.
8080
super(name, true, false, false, tsi, meta, isSyntheticSource, isWithinMultiField);
8181
this.indexAnalyzer = Objects.requireNonNull(indexAnalyzer);

0 commit comments

Comments
 (0)