protected function rewriteQueryFilterParameters(Filter $filter, SelectQuery $query, $field)
    {
        $boltName = $query->getContentType();

        $newExpression = $this->em->createExpressionBuilder();
        $count = 0;
        foreach ($query->getWhereParametersFor($field) as $paramKey => $paramValue) {
            $parameterParts = explode('_', $paramKey);
            array_pop($parameterParts);
            array_shift($parameterParts);
            $subkey = join('_', $parameterParts);

            $parser = new QueryParameterParser($newExpression);
            $parsed = $parser->parseValue($paramValue);
            $placeholder = $paramKey;
            $q = $this->em->createQueryBuilder();
            $q->addSelect('content_id')
                ->from($this->mapping['tables']['field_value'], 'f')
                ->andWhere("f.content_id = _$boltName.id")
                ->andWhere("f.contenttype = '$boltName'")
                ->andWhere("f.name = '$field'")
                ->andWhere("f.fieldname = '" . $subkey . "'")
                ->andWhere(
                    $q->expr()
                        ->orX()
                        ->add(
                            $q->expr()->{$parsed['operator']}('f.value_text', ':' . $placeholder)
                        )
                        ->add(
                            $q->expr()->{$parsed['operator']}('f.value_string', ':' . $placeholder)
                        )
                        ->add(
                            $q->expr()->{$parsed['operator']}('f.value_json_array', ':' . $placeholder)
                        )
                );
            $filter->setParameter($placeholder, $parsed['value']);
            $count++;
        }
        $comp = $newExpression->andX($newExpression->in('_' . $boltName . '.id', $q->getSQL()));
        $filter->setKey('_' . $boltName . '.id');
        $filter->setExpression($comp);
    }