Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17325069
D12432.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12432.diff
View Options
diff --git a/src/applications/search/engine/PhabricatorSearchEngineElastic.php b/src/applications/search/engine/PhabricatorSearchEngineElastic.php
--- a/src/applications/search/engine/PhabricatorSearchEngineElastic.php
+++ b/src/applications/search/engine/PhabricatorSearchEngineElastic.php
@@ -93,6 +93,7 @@
private function buildSpec(PhabricatorSavedQuery $query) {
$spec = array();
$filter = array();
+ $title_spec = array();
if (strlen($query->getParameter('query'))) {
$spec[] = array(
@@ -101,6 +102,13 @@
'fields' => array( 'field.corpus' ),
),
);
+
+ $title_spec = array(
+ 'simple_query_string' => array(
+ 'query' => $query->getParameter('query'),
+ 'fields' => array('title'),
+ ),
+ );
}
$exclude = $query->getParameter('exclude');
@@ -174,6 +182,9 @@
if ($spec) {
$spec = array('query' => array('bool' => array('must' => $spec)));
+ if ($title_spec) {
+ $spec['query']['bool']['should'] = $title_spec;
+ }
}
if ($filter) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 28, 12:47 AM (10 h, 25 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8203698
Default Alt Text
D12432.diff (1 KB)
Attached To
Mode
D12432: T7827: Boost Elasticsearch results on title match.
Attached
Detach File
Event Timeline
Log In to Comment