port to 4.1 PHRAS-1831

This commit is contained in:
aina-esokia
2018-11-05 15:02:55 +04:00
parent e113d926c2
commit 2eeb1721e9
3 changed files with 5 additions and 3 deletions

View File

@@ -27,8 +27,9 @@ class Query
{
$query = $this->root->buildQuery($context);
if ($query === null) {
$query = [];
$query['bool']['must'] = [];
//$query = ['bool'=> ['must' => []]];
// a null query shoud return no results !
$query = ['constant_score'=> ['filter' => new \stdClass]];
}
return $query;

View File

@@ -60,6 +60,7 @@ class Thesaurus
// TODO Use bulk queries for performance
$concepts = array();
foreach ($terms as $index => $term) {
$strict = ($term instanceof AST\TermNode); // a "term" node is [strict group of words]
$concepts[] = $this->findConcepts($term, $lang, $filters[$index], $strict);
}