mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
port to 4.1 PHRAS-1831
This commit is contained in:
@@ -27,8 +27,9 @@ class Query
|
|||||||
{
|
{
|
||||||
$query = $this->root->buildQuery($context);
|
$query = $this->root->buildQuery($context);
|
||||||
if ($query === null) {
|
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;
|
return $query;
|
||||||
|
@@ -60,6 +60,7 @@ class Thesaurus
|
|||||||
// TODO Use bulk queries for performance
|
// TODO Use bulk queries for performance
|
||||||
$concepts = array();
|
$concepts = array();
|
||||||
foreach ($terms as $index => $term) {
|
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);
|
$concepts[] = $this->findConcepts($term, $lang, $filters[$index], $strict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1217,7 +1217,7 @@ class databox extends base implements ThumbnailedElement
|
|||||||
if ($domct !== false) {
|
if ($domct !== false) {
|
||||||
$nodesToDel = [];
|
$nodesToDel = [];
|
||||||
for($n = $domct->documentElement->firstChild; $n; $n = $n->nextSibling) {
|
for($n = $domct->documentElement->firstChild; $n; $n = $n->nextSibling) {
|
||||||
if(!($n->getAttribute('delbranch'))){
|
if($n->nodeType == XML_ELEMENT_NODE && !($n->getAttribute('delbranch'))){
|
||||||
$nodesToDel[] = $n;
|
$nodesToDel[] = $n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user