private function prepareSimpleIndexAttributeValue(AttributeInterface $attribute, $value)
    {
        if ($this->getFieldType($attribute) == FieldInterface::FIELD_TYPE_BOOLEAN) {
            $value = boolval($value);
        } elseif ($attribute->getBackendType() == 'decimal') {
            $value = floatval($value);
        } elseif ($attribute->getBackendType() == 'int') {
            $value = intval($value);
        }

        return $value;
    }
private function prepareSimpleIndexAttributeValue(AttributeInterface $attribute, $value)
    {
        if ($this->getFieldType($attribute) == FieldInterface::FIELD_TYPE_BOOLEAN) {
            $value = boolval($value);
        } elseif ($attribute->getBackendType() == 'decimal') {
            $value = floatval($value);
        } elseif ($attribute->getBackendType() == 'int') {
            $value = intval($value);
        }

        return $value;
    }
private function prepareSimpleIndexAttributeValue ( AttributeInterface $ attribute , $ value ) { if ( $ this -> getFieldType ( $ attribute ) == FieldInterface :: FIELD_TYPE_BOOLEAN ) { $ value = boolval ( $ value ) ; } elseif ( $ attribute -> getBackendType ( ) == 'decimal' ) { $ value = floatval ( $ value ) ; } elseif ( $ attribute -> getBackendType ( ) == 'int' ) { $ value = intval ( $ value ) ; } return $ value ; }
Ensure types of numerical values is correct before indexing.

@param AttributeInterface $attribute Product attribute.
@param mixed              $value     Raw value.

@return mixed
Ensure types of numerical values is correct before indexing .