1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 22:40:55 +01:00

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
This commit is contained in:
Chad Horohoe 2014-12-22 13:00:32 -08:00 committed by epriestley
parent bdda61184b
commit c953c0fedc

View file

@ -99,11 +99,9 @@ final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine {
if (strlen($query->getParameter('query'))) { if (strlen($query->getParameter('query'))) {
$spec[] = array( $spec[] = array(
'match' => array( 'simple_query_string' => array(
'field.corpus' => array( 'query' => $query->getParameter('query'),
'operator' => 'and', 'fields' => array( 'field.corpus' ),
'query' => $query->getParameter('query'),
),
), ),
); );
} }