Skip to content

Commit a04d246

Browse files
Add semantic_text to mapping_all_types and switch to TranslationAware in PushFiltersToSource (elastic#118982) (elastic#119635)
* Add semantic_text to mapping-all-types.json and switch to TranslationAware in PushFiltersToSource * Continue to use FullTextFunction for now --------- Co-authored-by: Elastic Machine <[email protected]>
1 parent 716109b commit a04d246

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-all-types.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
},
6060
"wildcard": {
6161
"type": "wildcard"
62+
},
63+
"semantic_text": {
64+
"type": "semantic_text",
65+
"inference_id": "foo_inference_id"
6266
}
6367
}
6468
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.elasticsearch.xpack.esql.core.util.CollectionUtils;
3232
import org.elasticsearch.xpack.esql.core.util.Queries;
3333
import org.elasticsearch.xpack.esql.expression.function.fulltext.FullTextFunction;
34-
import org.elasticsearch.xpack.esql.expression.function.fulltext.Term;
3534
import org.elasticsearch.xpack.esql.expression.function.scalar.ip.CIDRMatch;
3635
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.BinarySpatialFunction;
3736
import org.elasticsearch.xpack.esql.expression.function.scalar.spatial.SpatialRelatesFunction;
@@ -252,8 +251,6 @@ static boolean canPushToSource(Expression exp, LucenePushdownPredicates lucenePu
252251
&& Expressions.foldable(cidrMatch.matches());
253252
} else if (exp instanceof SpatialRelatesFunction spatial) {
254253
return canPushSpatialFunctionToSource(spatial, lucenePushdownPredicates);
255-
} else if (exp instanceof Term term) {
256-
return term.field() instanceof FieldAttribute && DataType.isString(term.field().dataType());
257254
} else if (exp instanceof FullTextFunction) {
258255
return true;
259256
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,11 +1401,6 @@ private void checkMatchFunctionPushDown(
14011401
var analyzer = makeAnalyzer("mapping-all-types.json", new EnrichResolution());
14021402
// Check for every possible query data type
14031403
for (DataType fieldDataType : fieldDataTypes) {
1404-
// TODO: semantic_text is not present in mapping-all-types.json so we skip it for now
1405-
if (fieldDataType == DataType.SEMANTIC_TEXT) {
1406-
continue;
1407-
}
1408-
14091404
var queryValue = randomQueryValue(fieldDataType);
14101405

14111406
String fieldName = fieldDataType == DataType.DATETIME ? "date" : fieldDataType.name().toLowerCase(Locale.ROOT);

0 commit comments

Comments
 (0)