simplify path type coercion in MatchQuery (#470)

This commit is contained in:
Adrian Sampson 2013-12-11 16:02:06 -08:00
parent 69e6ef7633
commit 1066c79b56

View file

@ -1027,10 +1027,7 @@ class MatchQuery(FieldQuery):
def col_clause(self):
pattern = self.pattern
if self.field == 'path':
if isinstance(pattern, unicode):
pattern = bytestring_path(pattern)
if isinstance(pattern, str):
pattern = buffer(pattern)
pattern = buffer(bytestring_path(pattern))
return self.field + " = ?", [pattern]
# We override the "raw" version here as a special case because we