From c953c0fedc1704f32d26e9d733713ea406f72222 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 22 Dec 2014 13:00:32 -0800 Subject: [PATCH] Switch normal query from match to simple_query_string Summary: It's like query_string but fails a little nicer on bad input. It also allows for limited Lucene syntax; notably exact string matches with quotation marks. Fixes T6780 Test Plan: Tested multiple query constructions, including exact string matching. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Maniphest Tasks: T6780 Differential Revision: https://secure.phabricator.com/D11011 --- .../search/engine/PhabricatorSearchEngineElastic.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/applications/search/engine/PhabricatorSearchEngineElastic.php b/src/applications/search/engine/PhabricatorSearchEngineElastic.php index 44bf71beb9..591617ba78 100644 --- a/src/applications/search/engine/PhabricatorSearchEngineElastic.php +++ b/src/applications/search/engine/PhabricatorSearchEngineElastic.php @@ -99,11 +99,9 @@ final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine { if (strlen($query->getParameter('query'))) { $spec[] = array( - 'match' => array( - 'field.corpus' => array( - 'operator' => 'and', - 'query' => $query->getParameter('query'), - ), + 'simple_query_string' => array( + 'query' => $query->getParameter('query'), + 'fields' => array( 'field.corpus' ), ), ); }