Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support operators in Phabricator search

Summary:
Boolean search supports operators, such as phrase search.
It can be further improved by setting [[http://dev.mysql.com/doc/mysql/en/server-system-variables.html#sysvar_ft_boolean_syntax | ft_boolean_syntax]] to `' |-><()~*:""&^'` (note the leading space):
Default value uses no operator for "optional word" and `+` for "mandatory word".
This value uses no operator for "mandatory word" and `|` for "optional word".

Test Plan: Search for "Enter the name" (with quotes).

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2064
  • Loading branch information...
commit 99704ed4851388e8a1561fb08e5f97ed26211d56 1 parent 4aef876
vrana authored
4 src/applications/search/engine/mysql/PhabricatorSearchEngineMySQL.php
View
@@ -1,7 +1,7 @@
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,7 +180,7 @@ public function executeSearch(PhabricatorSearchQuery $query) {
"{$t_field} field ON field.phid = document.phid");
$where[] = qsprintf(
$conn_r,
- 'MATCH(corpus) AGAINST (%s)',
+ 'MATCH(corpus) AGAINST (%s IN BOOLEAN MODE)',
$q);
// When searching for a string, promote user listings above other
Please sign in to comment.
Something went wrong with that request. Please try again.