*/ private $terms; /** * @var array */ private $metadata; /** * @param array $terms stem => tf * @param array $metadata Additional metadata from the provider. */ public function __construct( array $terms, array $metadata = array() ) { $this->terms = $terms; $this->metadata = $metadata; } /** * @return array */ public function terms(): array { return $this->terms; } /** * @return array */ public function metadata(): array { return $this->metadata; } /** * Whether the provider intentionally returned an empty set (e.g. below thresholds). * * @return bool */ public function is_filtered(): bool { return (bool) ( $this->metadata['filtered'] ?? false ); } }