name = $name; $this->set = $set; } public function buildQuery(QueryContext $context) { // TODO Ensure flag exists $key = RecordHelper::normalizeFlagKey($this->name); $field = sprintf('flags.%s', $key); return [ 'term' => [ $field => $this->set ] ]; } public function getTermNodes() { return array(); } public function __toString() { return sprintf('', $this->name, $this->set ? 'set' : 'cleared'); } }