public function operatorterm(Query $query, TokenInterface $token)
    {
        $terms = explode(',', strtolower($token->value()));
        $conjunction = $token->negated() ? 'NOT IN' : 'IN';

        if (empty($terms)) {
            return $query;
        }

        $conditions = [
            "Contents.id {$conjunction}" => TableRegistry::get('Taxonomy.EntitiesTerms')
                ->find()
                ->select(['EntitiesTerms.entity_id'])
                ->where(['EntitiesTerms.table_alias' => $this->alias()])
                ->matching('Terms', function ($q) use ($terms) {
                    return $q->where(['Terms.slug IN' => $terms]);
                })
        ];

        if (!empty($conditions)) {
            if ($token->where() === 'or') {
                $query->orWhere($conditions);
            } elseif ($token->where() === 'and') {
                $query->andWhere($conditions);
            } else {
                $query->where($conditions);
            }
        }

        return $query;
    }