Commit edd2031
Katharina Puchstein
FEATURE: Support
We want to support phrase searches like `"Neos and Flow"`, where
quotes mean "I want this exact phrase" (similar to many search engines).
When using the .fulltext() query, this did not work, and we sometimes
encountered crashes when the query string contained quotes, f.e. `"Hallo"`
or `Ha"llo"`.
This is because the .fulltext() query does some magic for supporting UTF8
(as it seems), namely: `trim(json_encode($searchWord, JSON_UNESCAPED_UNICODE), '"')`.
This removes some quotes, but not all of them :-)
The simple_query_string query of Elasticsearch exposes a query string syntax
which the user is directly allowed to enter:
> While its syntax is more limited than the query_string query, the simple_query_string
> query does not return errors for invalid syntax. Instead, it ignores any invalid
> parts of the query string.
This is exactly what we want for a good search field behavior.
NOTE: We created an additional method because we were unsure about breaking
backwards compatibility; but we think `simpleQueryStringFulltext()` should
be used almost universally as replacement for `fulltext()`, as it returns
better results and does not throw exceptions...simpleQueryStringFulltext() simple query string query for fulltext search1 parent 301154e commit edd2031
File tree
4 files changed
+54
-4
lines changed- Classes
- Driver
- Version6/Query
- Eel
- Configuration
4 files changed
+54
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
70 | 84 | | |
71 | 85 | | |
72 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
668 | 666 | | |
669 | 667 | | |
670 | 668 | | |
671 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
687 | 713 | | |
688 | 714 | | |
689 | 715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
0 commit comments