presto-elasticsearch/src/main/java/io/prestosql/elasticsearch/ElasticsearchMetadata.java/ElasticsearchMetadata/applyFilter
class ElasticsearchMetadata:    @Override
    public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(ConnectorSession session, ConnectorTableHandle table, Constraint constraint)
    {
        ElasticsearchTableHandle handle = (ElasticsearchTableHandle) table;

        TupleDomain<ColumnHandle> oldDomain = handle.getConstraint();
        TupleDomain<ColumnHandle> newDomain = oldDomain.intersect(constraint.getSummary());
        if (oldDomain.equals(newDomain)) {
            return Optional.empty();
        }

        handle = new ElasticsearchTableHandle(
                handle.getSchema(),
                handle.getIndex(),
                handle.getConstraint(),
                handle.getQuery());

        return Optional.of(new ConstraintApplicationResult<>(handle, constraint.getSummary()));
    }