Skip to content
Snippets Groups Projects
Commit 32909db3 authored by Simonas Šerlinskas's avatar Simonas Šerlinskas
Browse files

fixed relevant method

parent 5cdb995b
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,8 @@ class BoolQuery implements BuilderInterface
public function isRelevant()
{
return
(count($this->container[self::MUST_NOT]) + count($this->container[self::SHOULD])) === 0
&& count($this->container[self::MUST]) == 1;
(count($this->container[self::MUST_NOT]) + count($this->container[self::SHOULD])) > 0
|| count($this->container[self::MUST]) > 1;
}
/**
......@@ -106,7 +106,7 @@ class BoolQuery implements BuilderInterface
{
$output = $this->processArray();
if ($this->isRelevant()) {
if (!$this->isRelevant()) {
/** @var BuilderInterface $query */
$mustContainer = $this->container[self::MUST];
$query = array_shift($mustContainer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment