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

switch from term query to match query

Summary:
Switch to the `match` query.  The operator is set to `and` because it defaults to `or` which is likely to annoy users.  We might want to consider using `query_string` to get booleans, wildcards, and other features.  The only problem with `query_string` is that it can allow querying on other fields in the json document, and we may want to prevent that.  That might even expose information we don't want to expose.  Another option would be to parse booleans ourselves and translate them to the ES query DSL.

fixes T5488

Test Plan: Try the `vpn`/`VPN` test case described in T5488.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: WikiChad, epriestley, Korvin

Maniphest Tasks: T5488

Differential Revision: https://secure.phabricator.com/D9785
This commit is contained in:
Lex 2014-07-09 15:47:07 -07:00 committed by epriestley
parent 4dd9be5c94
commit a230e0fab7

View file

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