Skip to content

Commit 07f92d7

Browse files
committed
Explain
1 parent a522cb9 commit 07f92d7

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import org.elasticsearch.index.fielddata.SourceValueFetcherSortedBinaryIndexFieldData;
6868
import org.elasticsearch.index.fielddata.StoredFieldSortedBinaryIndexFieldData;
6969
import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData;
70+
import org.elasticsearch.index.query.MatchQueryBuilder;
7071
import org.elasticsearch.index.query.SearchExecutionContext;
7172
import org.elasticsearch.index.similarity.SimilarityProvider;
7273
import org.elasticsearch.script.field.DelegateDocValuesField;
@@ -714,7 +715,10 @@ public static class TextFieldType extends StringFieldType {
714715
*/
715716
private final KeywordFieldMapper.KeywordFieldType syntheticSourceDelegate;
716717

717-
// NOCOMMIT docs
718+
/**
719+
* Does a {@link MatchQueryBuilder} produce <strong>all</strong> documents
720+
* that <strong>might</strong> have equal text to the query's value.
721+
*/
718722
private final boolean matchQueryYieldsCandidateMatchesForEquality;
719723

720724
public TextFieldType(

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/lucene/ValuesSourceReaderOperatorTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@ private TextFieldMapper.TextFieldType storedTextField(String name) {
14211421
null,
14221422
Map.of(),
14231423
false,
1424+
false,
14241425
false
14251426
);
14261427
}
@@ -1435,6 +1436,7 @@ private TextFieldMapper.TextFieldType textFieldWithDelegate(String name, Keyword
14351436
delegate,
14361437
Map.of(),
14371438
false,
1439+
false,
14381440
false
14391441
);
14401442
}

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/PushQueriesIT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
package org.elasticsearch.xpack.esql.qa.single_node;
99

1010
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
11-
import com.carrotsearch.randomizedtesting.annotations.Repeat;
1211
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
1312

14-
import org.elasticsearch.client.Request;
1513
import org.apache.lucene.analysis.standard.StandardAnalyzer;
14+
import org.elasticsearch.client.Request;
1615
import org.elasticsearch.client.Response;
1716
import org.elasticsearch.client.ResponseException;
1817
import org.elasticsearch.common.collect.Iterators;
@@ -35,7 +34,6 @@
3534
import java.util.Locale;
3635
import java.util.Map;
3736
import java.util.regex.Pattern;
38-
import java.util.stream.Stream;
3937

4038
import static org.elasticsearch.test.ListMatcher.matchesList;
4139
import static org.elasticsearch.test.MapMatcher.assertMap;
@@ -53,7 +51,7 @@
5351
/**
5452
* Tests for pushing queries to lucene.
5553
*/
56-
//@Repeat(iterations = 50)
54+
// @Repeat(iterations = 50)
5755
@ThreadLeakFilters(filters = TestClustersThreadFilter.class)
5856
public class PushQueriesIT extends ESRestTestCase {
5957
@ClassRule

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/physical/local/LucenePushdownPredicates.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package org.elasticsearch.xpack.esql.optimizer.rules.physical.local;
99

10+
import org.elasticsearch.index.query.MatchQueryBuilder;
1011
import org.elasticsearch.xpack.esql.core.expression.Expression;
1112
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
1213
import org.elasticsearch.xpack.esql.core.expression.MetadataAttribute;
@@ -47,9 +48,15 @@ public interface LucenePushdownPredicates {
4748
*/
4849
boolean isIndexed(FieldAttribute attr);
4950

51+
/**
52+
* Can the synthetic _source delegate perform {@code ==} on the provided string?
53+
*/
5054
boolean canUseEqualityOnSyntheticSourceDelegate(FieldAttribute attr, String value);
5155

52-
// NOCOMMIT javadoc this and above
56+
/**
57+
* Does a {@link MatchQueryBuilder} produce a complete list of all possible documents
58+
* that <strong>might</strong> be {@code ==} to the value passed to the query.
59+
*/
5360
boolean matchQueryYieldsCandidateMatchesForEquality(FieldAttribute attr);
5461

5562
/**

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/LocalPhysicalPlanOptimizerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ public void testOutOfRangeFilterPushdown() {
795795
var query = "from test | where " + comparison;
796796
Source expectedSource = new Source(1, 18, comparison);
797797

798-
logger.info("Query: " + query);
798+
logger.info("Query: {}", query);
799799
EsQueryExec actualQueryExec = doTestOutOfRangeFilterPushdown(query, allTypeMappingAnalyzer);
800800

801801
assertThat(actualQueryExec.query(), is(instanceOf(SingleValueQuery.Builder.class)));

0 commit comments

Comments
 (0)