This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Commit 867d2fe
authored
Fix Lucene query behavior (match operator) (#1426)
Lucene syntax is not expected to behave the way Quesma handles it.
Using default text fields, for query like: `myText: getAcc` it is going
to perform case-insensitive, exact match.
This became apparent when playing with Grafana
<img width="1488" alt="image"
src="https://github.com/user-attachments/assets/ce108b02-d8a1-494a-8d44-167ad8c4c492"
/>
but also applies to Kibana when switching to Lucene query language.
<img width="620" alt="image"
src="https://github.com/user-attachments/assets/db374571-8552-4e2c-88f9-a1cec0342136"
/>
We still do not fully implement Lucene syntax translation, but this
definitely brings us closer by at least matching the default behavior.
## Useful notes for reproducing this situation 👇
<details>
```bash
## Create two indices to have comparison
curl -X PUT "http://localhost:8080/es" -H 'Content-Type: application/json' -d '
{
"mappings": {
"properties": {
"myText": {
"type": "text"
},
"@timestamp": {
"type": "date"
}
}
}
}'
curl -X PUT "http://localhost:8080/ch" -H 'Content-Type: application/json' -d '
{
"mappings": {
"properties": {
"myText": {
"type": "text"
}
}
}
}'
## Example dataset, save into `data.ndjson`
{"index": {"_index": "es"}}
{"myText": "getAccomondationStatus", "@timestamp": "2025-05-13T10:00:00Z"}
{"index": {"_index": "es"}}
{"myText": "getAccomodationOffer", "@timestamp": "2025-05-13T10:01:00Z"}
{"index": {"_index": "es"}}
{"myText": "getAccomodation", "@timestamp": "2025-05-13T10:02:00Z"}
{"index": {"_index": "ch"}}
{"myText": "getAccomondationStatus", "@timestamp": "2025-05-13T10:00:00Z"}
{"index": {"_index": "ch"}}
{"myText": "getAccomodationOffer", "@timestamp": "2025-05-13T10:01:00Z"}
{"index": {"_index": "ch"}}
{"myText": "getAccomodation", "@timestamp": "2025-05-13T10:02:00Z"}
```
## Load data
curl -X POST "http://localhost:8080/_bulk" \
-H "Content-Type: application/x-ndjson" \
--data-binary "@data.ndjson"
</details>
Fixes: #14251 parent c6db0b3 commit 867d2fe
File tree
8 files changed
+92
-93
lines changed- platform
- frontend_connectors
- parsers/elastic_query_dsl/lucene
- testdata
- clients
8 files changed
+92
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | | - | |
1140 | | - | |
| 1139 | + | |
1141 | 1140 | | |
1142 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1143 | 1145 | | |
1144 | 1146 | | |
1145 | 1147 | | |
| |||
Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
1118 | | - | |
| 1118 | + | |
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
| 861 | + | |
| 862 | + | |
863 | 863 | | |
864 | | - | |
865 | | - | |
| 864 | + | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
804 | | - | |
| 803 | + | |
| 804 | + | |
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
817 | | - | |
| 816 | + | |
| 817 | + | |
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
835 | | - | |
836 | | - | |
| 835 | + | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| |||
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
850 | | - | |
851 | | - | |
| 850 | + | |
| 851 | + | |
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
870 | | - | |
| 869 | + | |
| 870 | + | |
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
885 | | - | |
| 884 | + | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
904 | | - | |
| 903 | + | |
| 904 | + | |
905 | 905 | | |
906 | 906 | | |
907 | 907 | | |
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
918 | | - | |
919 | | - | |
| 918 | + | |
| 919 | + | |
920 | 920 | | |
921 | 921 | | |
922 | 922 | | |
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
938 | | - | |
| 937 | + | |
| 938 | + | |
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
| |||
1638 | 1638 | | |
1639 | 1639 | | |
1640 | 1640 | | |
1641 | | - | |
| 1641 | + | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | 1644 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
| 351 | + | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
| 365 | + | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
385 | | - | |
| 384 | + | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | | - | |
| 399 | + | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
| 418 | + | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
1255 | | - | |
| 1255 | + | |
1256 | 1256 | | |
1257 | | - | |
| 1257 | + | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
| |||
1279 | 1279 | | |
1280 | 1280 | | |
1281 | 1281 | | |
1282 | | - | |
| 1282 | + | |
1283 | 1283 | | |
1284 | | - | |
| 1284 | + | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
| |||
1377 | 1377 | | |
1378 | 1378 | | |
1379 | 1379 | | |
1380 | | - | |
| 1380 | + | |
1381 | 1381 | | |
1382 | | - | |
| 1382 | + | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
| |||
0 commit comments