diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/querydsl/query/SingleValueMatchQuery.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/querydsl/query/SingleValueMatchQuery.java index 65ec5765e8731..3790890262455 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/querydsl/query/SingleValueMatchQuery.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/querydsl/query/SingleValueMatchQuery.java @@ -37,7 +37,17 @@ import java.util.Objects; /** - * Finds all fields with a single-value. If a field has a multi-value, it emits a {@link Warnings}. + * Finds all fields with a single-value. If a field has a multi-value, it emits + * a {@link Warnings warning}. + *

+ * Warnings are only emitted if the {@link TwoPhaseIterator#matches}. Meaning that, + * if the other query skips the doc either because the index doesn't match or because it's + * {@link TwoPhaseIterator#matches} doesn't match, then we won't log warnings. So it's + * most safe to say that this will emit a warning if the document would have + * matched but for having a multivalued field. If the document doesn't match but + * "almost" matches in some fairly lucene-specific ways then it *might* emit + * a warning. + *

*/ public final class SingleValueMatchQuery extends Query { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/CsvTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/CsvTests.java index 3fd6ee94b56bc..90d171bd9796a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/CsvTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/CsvTests.java @@ -30,6 +30,7 @@ import org.elasticsearch.compute.operator.DriverRunner; import org.elasticsearch.compute.operator.exchange.ExchangeSinkHandler; import org.elasticsearch.compute.operator.exchange.ExchangeSourceHandler; +import org.elasticsearch.compute.querydsl.query.SingleValueMatchQuery; import org.elasticsearch.core.Releasables; import org.elasticsearch.core.Tuple; import org.elasticsearch.index.IndexMode; @@ -153,6 +154,17 @@ * it’s creating its own Source physical operator, aggregation operator (just a tiny bit of it) and field extract operator. *

* To log the results logResults() should return "true". + *

+ * This test never pushes to Lucene because there isn't a Lucene index to push to. It always runs everything in + * the compute engine. This yields the same results modulo a few things: + *

*/ // @TestLogging(value = "org.elasticsearch.xpack.esql:TRACE,org.elasticsearch.compute:TRACE", reason = "debug") public class CsvTests extends ESTestCase {