Skip to content

Commit a80e0d2

Browse files
committed
Made the hash include fields and ranges.
1 parent 8ebe0ca commit a80e0d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lucenequerybuilder/query.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def __eq__(self, other):
112112
return hash(self) == hash(other)
113113

114114
def __hash__(self):
115-
return hash((tuple(self.should), tuple(self.must), tuple(self.must_not)))
115+
return hash((tuple(self.should), tuple(self.must),tuple(self.must_not),
116+
self.exrange if hasattr(self, 'exrange') else None,
117+
self.inrange if hasattr(self, 'inrange') else None,
118+
self.field if hasattr(self, 'field') else None))
116119

117120
def __str__(self):
118121
rv = ''

0 commit comments

Comments
 (0)