def to_index_value(self, value, index):
<EOL>if isinstance(value, HTTPRequest.record):<EOL><INDENT>return value<EOL><DEDENT>if isinstance(index, basestring):<EOL><INDENT>index = self.get_index(index)<EOL><DEDENT>if index.id == "<STR_LIT>":<EOL><INDENT>return filter(lambda x: x, _.to_list(value))<EOL><DEDENT>if index.meta_type == "<STR_LIT>":<EOL><INDENT>return DateTime(value)<EOL><DEDENT>if index.meta_type == "<STR_LIT>":<EOL><INDENT>return bool(value)<EOL><DEDENT>if index.meta_type == "<STR_LIT>":<EOL><INDENT>return value.split("<STR_LIT:U+002C>")<EOL><DEDENT>return value<EOL>
Convert the value for a given index