mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-28 05:56:02 +03:00
Enable elastic query syntax (#1202)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
dd809242b1
commit
e875f51ad3
@ -27,14 +27,13 @@ class ElasticAdapter implements FullTextAdapter {
|
||||
|
||||
async search (_class: Ref<Class<Doc>>, query: DocumentQuery<Doc>, size: number | undefined, from: number | undefined): Promise<IndexedDoc[]> {
|
||||
if (query.$search === undefined) return []
|
||||
const search = query.$search.replace(/[\\/+\-=&><!()|{}^"~*&:[\]]/g, '\\$&')
|
||||
|
||||
const request: any = {
|
||||
bool: {
|
||||
must: [
|
||||
{
|
||||
multi_match: {
|
||||
query: search
|
||||
query_string: {
|
||||
query: query.$search,
|
||||
default_operator: 'and'
|
||||
}
|
||||
}
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user