Wrap text and concept queries with a single filtered query

This commit is contained in:
Mathieu Darse
2015-08-26 19:26:07 +02:00
parent d6a44c8a52
commit 064c5e01a6
2 changed files with 24 additions and 40 deletions

View File

@@ -192,22 +192,6 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
"operator": "and",
"lenient": true
}
}, {
"filtered": {
"filter": {
"terms": {
"base_id": [1, 2, 3]
}
},
"query": {
"multi_match": {
"fields": ["private_caption.bar.fr", "private_caption.bar.en"],
"query": "baz",
"operator": "and",
"lenient": true
}
}
}
}, {
"multi_match": {
"fields": [
@@ -223,9 +207,20 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
}
},
"query": {
"multi_match": {
"fields": ["concept_path.bar"],
"query": "/qux"
"bool": {
"should": [{
"multi_match": {
"fields": ["private_caption.bar.fr", "private_caption.bar.en"],
"query": "baz",
"operator": "and",
"lenient": true
}
}, {
"multi_match": {
"fields": ["concept_path.bar"],
"query": "/qux"
}
}]
}
}
}