You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reenables `text ==` pushdown and adds support for `text !=` pushdown.
It does so by making `TranslationAware#translatable` return something
we can turn into a tri-valued function. It has these values:
* `YES`
* `NO`
* `RECHECK`
`YES` means the `Expression` is entirely pushable into Lucene. They will
be pushed into Lucene and removed from the plan.
`NO` means the `Expression` can't be pushed to Lucene at all and will stay
in the plan.
`RECHECK` mean the `Expression` can push a query that makes *candidate*
matches but must be rechecked. Documents that don't match the query won't
match the expression, but documents that match the query might not match
the expression. These are pushed to Lucene *and* left in the plan.
This is required because `txt != "b"` can build a *candidate* query
against the `txt.keyword` subfield but it can't be sure of the match
without loading the `_source` - which we do in the compute engine.
I haven't plugged rally into this, but here's some basic
performance tests:
```
Before:
not text eq {"took":460,"documents_found":1000000}
text eq {"took":432,"documents_found":1000000}
After:
text eq {"took":5,"documents_found":1}
not text eq {"took":351,"documents_found":800000}
```
This comes from:
```
rm -f /tmp/bulk*
for a in {1..1000}; do
echo '{"index":{}}' >> /tmp/bulk
echo '{"text":"text '$(printf $(($a % 5)))'"}' >> /tmp/bulk
done
ls -l /tmp/bulk*
passwd="redacted"
curl -sk -uelastic:$passwd -HContent-Type:application/json -XDELETE https://localhost:9200/test
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPUT https://localhost:9200/test -d'{
"settings": {
"index.codec": "best_compression",
"index.refresh_interval": -1
},
"mappings": {
"properties": {
"many": {
"enabled": false
}
}
}
}'
for a in {1..1000}; do
printf %04d: $a
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPOST https://localhost:9200/test/_bulk?pretty --data-binary @/tmp/bulk | grep errors
done
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPOST https://localhost:9200/test/_forcemerge?max_num_segments=1
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPOST https://localhost:9200/test/_refresh
echo
curl -sk -uelastic:$passwd https://localhost:9200/_cat/indices?v
text_eq() {
echo -n " text eq "
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPOST 'https://localhost:9200/_query?pretty' -d'{
"query": "FROM test | WHERE text == \"text 1\" | STATS COUNT(*)",
"pragma": {
"data_partitioning": "shard"
}
}' | jq -c '{took, documents_found}'
}
not_text_eq() {
echo -n "not text eq "
curl -sk -uelastic:$passwd -HContent-Type:application/json -XPOST 'https://localhost:9200/_query?pretty' -d'{
"query": "FROM test | WHERE NOT text == \"text 1\" | STATS COUNT(*)",
"pragma": {
"data_partitioning": "shard"
}
}' | jq -c '{took, documents_found}'
}
for a in {1..100}; do
text_eq
not_text_eq
done
```
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/PushQueriesIT.java
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/qa/testFixtures/src/main/resources/data/mv_text.csv
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,4 @@
3
3
2023-10-23T13:55:01.544Z,Connected to 10.1.0.1
4
4
2023-10-23T13:55:01.545Z,[Connected to 10.1.0.1, More than one hundred characters long so it isn't indexed by the sub keyword field with ignore_above:100]
5
5
2023-10-23T13:55:01.546Z,More than one hundred characters long so it isn't indexed by the sub keyword field with ignore_above:100
6
+
2023-10-23T13:55:01.547Z,[More than one hundred characters long so it isn't indexed by the sub keyword field with ignore_above:100,Second than one hundred characters long so it isn't indexed by the sub keyword field with ignore_above:100]
0 commit comments