Browse Source
fix: elasticsearch partial match (#1882)
Improved full text search in elastic provider
pull/1886/head
kaziu687
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
20 additions and
2 deletions
-
server/modules/search/elasticsearch/engine.js
|
|
@ -92,8 +92,26 @@ module.exports = { |
|
|
|
index: this.config.indexName, |
|
|
|
body: { |
|
|
|
query: { |
|
|
|
simple_query_string: { |
|
|
|
query: q |
|
|
|
bool: { |
|
|
|
filter: [ |
|
|
|
{ |
|
|
|
bool: { |
|
|
|
should: [ |
|
|
|
{ |
|
|
|
simple_query_string: { |
|
|
|
query: q |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
query_string: { |
|
|
|
query: "*" + q + "*" |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
minimum_should_match: 1 |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
from: 0, |
|
|
|