AnsweredAssumed Answered

How can we use "AND Function" in GlobalSearch on Sugar 7.7.x.x?

Question asked by YOSHINORI MASUDA on Jul 4, 2016

We are using SugarCRM version 7.5.2.1.

We customize /sugarroot/include/SugarSearchEngine/Elastic/SugarSearchEngineElastic.php to use "AND Funtion" in GlobalSearch(full text search).

but the file was changed a lot on SugarCRM version 7.7.0.0. and "AND Funtion" in GlobalSearch looks no longer available.

How can we use "AND Function" in GlobalSearch on Sugar 7.7.x.x?

 

 

/sugarroot/include/SugarSearchEngine/Elastic/SugarSearchEngineElastic.php

Line 770-

$qString = str_replace('/', '\\/', $qString);

//add 2 lines

$qString = '"'.$qString.'"';

$qString = preg_replace('/\s+/', '" && "', $qString)

 

$queryObj = new \Elastica\Query\QueryString($qString);

$queryObj->setAnalyzeWildcard(true);

//add 1 line

$queryObj->setRewrite("scoring_boolean");

$queryObj->setAutoGeneratePhraseQueries(false);

Outcomes