Skip to content
Permalink
Browse files

Added compatibility with Elasticsearch v5

  • Loading branch information...
thorsten committed Mar 24, 2017
1 parent e8fa9c8 commit 6b1fb32194f2eb1aeced5a40fb5093db7ee4485e
Showing with 13 additions and 19 deletions.
  1. +13 −19 phpmyfaq/inc/PMF/Search/Elasticsearch.php
@@ -76,25 +76,19 @@ public function search($searchTerm)
'size' => 1000,
'body' => [
'query' => [
'filtered' => [
'filter' => [
'bool' => [
'must' => [
[
'terms' => ['category_id' => $this->getCategoryIds()]
]
]
]
],
'query' => [
'bool' => [
'must' => [
'multi_match' => [
'fields' => [
'question', 'answer', 'keywords'
],
'query' => $searchTerm,
'fuzziness' => 'AUTO'
]
]
],
'filter' => [
'terms' => ['category_id' => $this->getCategoryIds()]
],
]
]
]
@@ -141,20 +135,20 @@ public function autoComplete($searchTerm)
'size' => 1000,
'body' => [
'query' => [
'filtered' => [
'filter' => [
'term' => [
'lang' => $this->getLanguage()
]
],
'query' => [
'bool' => [
'must' => [
'multi_match' => [
'fields' => [
'question', 'answer', 'keywords'
],
'query' => $searchTerm,
'fuzziness' => 'AUTO'
]
],
'filter' => [
'term' => [
'lang' => $this->getLanguage()
]
]
]
]

0 comments on commit 6b1fb32

Please sign in to comment.
You can’t perform that action at this time.