Skip to content

Commit 355aed7

Browse files
Add semantic_text to mapping_all_types and switch to TranslationAware in PushFiltersToSource (elastic#118982)
* 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 56becc5 commit 355aed7

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
@@ -1450,11 +1450,6 @@ private void checkMatchFunctionPushDown(
14501450
var analyzer = makeAnalyzer("mapping-all-types.json");
14511451
// Check for every possible query data type
14521452
for (DataType fieldDataType : fieldDataTypes) {
1453-
// TODO: semantic_text is not present in mapping-all-types.json so we skip it for now
1454-
if (fieldDataType == DataType.SEMANTIC_TEXT) {
1455-
continue;
1456-
}
1457-
14581453
var queryValue = randomQueryValue(fieldDataType);
14591454

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

0 commit comments

Comments
 (0)