public function attr($map, array $attributes)
    {
        return function(Expression $expr, $compiler) use ($map, $attributes)
        {
            $luceneExpr = $map($expr, $compiler);

            foreach ($attributes as $name => $value) {
                $luceneExpr[$name] = $value;
            }

            return $luceneExpr;
        };
    }
public function attr($map, array $attributes)
    {
        return function(Expression $expr, $compiler) use ($map, $attributes)
        {
            $luceneExpr = $map($expr, $compiler);

            foreach ($attributes as $name => $value) {
                $luceneExpr[$name] = $value;
            }

            return $luceneExpr;
        };
    }
public function attr ( $ map , array $ attributes ) { return function ( Expression $ expr , $ compiler ) use ( $ map , $ attributes ) { $ luceneExpr = $ map ( $ expr , $ compiler ) ; foreach ( $ attributes as $ name => $ value ) { $ luceneExpr [ $ name ] = $ value ; } return $ luceneExpr ; } ; }
Set attributes in the resulting expression.

@param $map
@param array $attributes
@return callable
Set attributes in the resulting expression .