Skip to content

Commit

Permalink
fix: elasticsearch partial match (#1882)
Browse files Browse the repository at this point in the history
Improved full text search in elastic provider
  • Loading branch information
kaziu687 authored May 13, 2020
1 parent d0cd340 commit 66e725f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions server/modules/search/elasticsearch/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 66e725f

Please sign in to comment.