|
|
@ -22,9 +22,8 @@ function generate( params ){ |
|
|
|
query.query.filtered.query = { |
|
|
|
query.query.filtered.query = { |
|
|
|
'bool': { |
|
|
|
'bool': { |
|
|
|
'must': [{
|
|
|
|
'must': [{
|
|
|
|
'multi_match': { |
|
|
|
'match': { |
|
|
|
'query': params.input, |
|
|
|
'name.default': params.input |
|
|
|
'fields': [ 'name.*' ] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
@ -36,9 +35,8 @@ function generate( params ){ |
|
|
|
// add shingles should query
|
|
|
|
// add shingles should query
|
|
|
|
// note: this is required for partial phrase matching
|
|
|
|
// note: this is required for partial phrase matching
|
|
|
|
query.query.filtered.query.bool.should.push({ |
|
|
|
query.query.filtered.query.bool.should.push({ |
|
|
|
'multi_match': { |
|
|
|
'match': { |
|
|
|
'query': params.input, |
|
|
|
'shingle.default': params.input |
|
|
|
'fields': [ 'shingle.*' ] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|