def toIndex(self, value):
if self._isIrNull(value):<EOL><INDENT>ret = IR_NULL_STR<EOL><DEDENT>else:<EOL><INDENT>ret = self._toIndex(value)<EOL><DEDENT>if self.isIndexHashed is False:<EOL><INDENT>return ret<EOL><DEDENT>return md5(tobytes(ret)).hexdigest()<EOL>
toIndex - An optional method which will return the value prepped for index.

By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
the field will be md5summed for indexing purposes. This is useful for large strings, etc.