From 061f151bc899636d483d857503ac758764777b12 Mon Sep 17 00:00:00 2001 From: Diana Shkolnikov Date: Thu, 4 Jun 2015 15:21:35 -0400 Subject: [PATCH] Revert "Use multi_match in name.* for /search" This reverts commit 3697627fb780ce80410915d08be9d5048dc1b7ee. --- query/search.js | 10 +++++----- test/unit/query/search.js | 24 +++++++++--------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/query/search.js b/query/search.js index e1cb33b0..fa33208a 100644 --- a/query/search.js +++ b/query/search.js @@ -21,12 +21,12 @@ function generate( params ){ // add search condition to filtered query query.query.filtered.query = { 'bool': { - 'must': [{ - 'multi_match': { - 'query': params.input, - 'fields': [ 'name.*' ] + 'must': [{ + 'match': { + 'name.default': params.input + } } - }] + ] } }; diff --git a/test/unit/query/search.js b/test/unit/query/search.js index 83aec714..cc8f7342 100644 --- a/test/unit/query/search.js +++ b/test/unit/query/search.js @@ -76,11 +76,9 @@ var expected = { 'filtered': { 'query': { 'bool': { - 'must': [ - { - 'multi_match': { - 'query': 'test', - 'fields': [ 'name.*' ] + 'must': [{ + 'match': { + 'name.default': 'test' } } ] @@ -156,11 +154,9 @@ module.exports.tests.query = function(test, common) { 'filtered': { 'query': { 'bool': { - 'must': [ - { - 'multi_match': { - 'query': 'test', - 'fields': [ 'name.*' ] + 'must': [{ + 'match': { + 'name.default': 'test' } } ] @@ -194,11 +190,9 @@ module.exports.tests.query = function(test, common) { 'filtered': { 'query': { 'bool': { - 'must': [ - { - 'multi_match': { - 'query': 'test', - 'fields': [ 'name.*' ] + 'must': [{ + 'match': { + 'name.default': 'test' } } ]