Browse Source

Use multi_match in name.* for /search

pull/131/head
Diana Shkolnikov 9 years ago
parent
commit
3697627fb7
  1. 5
      query/search.js
  2. 24
      test/unit/query/search.js

5
query/search.js

@ -22,8 +22,9 @@ function generate( params ){
query.query.filtered.query = {
'bool': {
'must': [{
'match': {
'name.default': params.input
'multi_match': {
'query': params.input,
'fields': [ 'name.*' ]
}
}
]

24
test/unit/query/search.js

@ -76,9 +76,11 @@ var expected = {
'filtered': {
'query': {
'bool': {
'must': [{
'match': {
'name.default': 'test'
'must': [
{
'multi_match': {
'query': 'test',
'fields': [ 'name.*' ]
}
}
]
@ -154,9 +156,11 @@ module.exports.tests.query = function(test, common) {
'filtered': {
'query': {
'bool': {
'must': [{
'match': {
'name.default': 'test'
'must': [
{
'multi_match': {
'query': 'test',
'fields': [ 'name.*' ]
}
}
]
@ -190,9 +194,11 @@ module.exports.tests.query = function(test, common) {
'filtered': {
'query': {
'bool': {
'must': [{
'match': {
'name.default': 'test'
'must': [
{
'multi_match': {
'query': 'test',
'fields': [ 'name.*' ]
}
}
]

Loading…
Cancel
Save