Elastica script isn't performing division

I've got a script (Elastica) :

$agg_car->setScript(" doc['field'].value / doc['field'].size() ");

that isn't performing the division. If I setScript as doc['field'].value it gives me 20, if I set it as doc['field'].size()it gives me 4. But when I put them both between a division I always get 20. As if the division isn't made and/or he's ignoring the size. I get the same result (20) in the following cases :

$agg_car->setScript(" doc['field'].value // doc['field'].size() ");
$agg_car->setScript(" doc['field'].value * doc['field'].size() ");
$agg_car->setScript(" doc['field'].size() * doc['field'].value ");

I only get an error in this case :

$agg_car->setScript(" doc['field'].size() / doc['field'].value ");

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.