From 77efb5cfa01387f6c6966551663fab1be3b4b664 Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 7 Oct 2016 13:10:21 +0200 Subject: [PATCH] fixed list search by adding query-string-query --- Controller/ArticleController.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Controller/ArticleController.php b/Controller/ArticleController.php index f430f0173..0e5d5af3a 100644 --- a/Controller/ArticleController.php +++ b/Controller/ArticleController.php @@ -16,8 +16,8 @@ use JMS\Serializer\SerializationContext; use ONGR\ElasticsearchBundle\Service\Manager; use ONGR\ElasticsearchDSL\Query\MatchAllQuery; +use ONGR\ElasticsearchDSL\Query\QueryStringQuery; use ONGR\ElasticsearchDSL\Query\TermQuery; -use ONGR\ElasticsearchDSL\Query\WildcardQuery; use ONGR\ElasticsearchDSL\Sort\FieldSort; use Sulu\Bundle\ArticleBundle\Document\Form\ArticleDocumentType; use Sulu\Component\Content\Form\Exception\InvalidFormException; @@ -93,11 +93,7 @@ public function cgetAction(Request $request) $search = $repository->createSearch(); if (!empty($searchPattern = $restHelper->getSearchPattern())) { - foreach ($restHelper->getSearchFields() as $searchField) { - $search->addQuery( - new WildcardQuery($this->uncamelize($searchField), '*' . strtolower($searchPattern) . '*') - ); - } + $search->addQuery(new QueryStringQuery($searchPattern . '*')); } if (null !== ($type = $request->get('type'))) {