diff --git a/src/Query/BoolQuery.php b/src/Query/BoolQuery.php index 3faed61a019b6a31277de9f28190c81b61dc5ba4..924ee6cc5af87eaa81f595639f2ea8f02c584cfa 100644 --- a/src/Query/BoolQuery.php +++ b/src/Query/BoolQuery.php @@ -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);