Skip to content

Commit e875f51

Browse files
authored
Enable elastic query syntax (#1202)
Signed-off-by: Denis Bykhov <[email protected]>
1 parent dd80924 commit e875f51

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/elastic/src/adapter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ class ElasticAdapter implements FullTextAdapter {
2727

2828
async search (_class: Ref<Class<Doc>>, query: DocumentQuery<Doc>, size: number | undefined, from: number | undefined): Promise<IndexedDoc[]> {
2929
if (query.$search === undefined) return []
30-
const search = query.$search.replace(/[\\/+\-=&><!()|{}^"~*&:[\]]/g, '\\$&')
31-
3230
const request: any = {
3331
bool: {
3432
must: [
3533
{
36-
multi_match: {
37-
query: search
34+
query_string: {
35+
query: query.$search,
36+
default_operator: 'and'
3837
}
3938
}
4039
],

0 commit comments

Comments
 (0)