diff options
author | Sascha Silbe <sascha@silbe.org> | 2009-08-09 18:09:23 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha@silbe.org> | 2009-08-13 22:36:16 (GMT) |
commit | 2a917b5941c3ac594e1e0ee3ae27622a47971965 (patch) | |
tree | cb0c8a214e77f812e6d6c942c03092a6bf05a36b | |
parent | 10a23f38aea17fad5228f15a9a5f5d9e19008b03 (diff) |
remove date range support in Xapian queries
-rw-r--r-- | src/carquinyol/indexstore.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/carquinyol/indexstore.py b/src/carquinyol/indexstore.py index bbd6d79..d66b10e 100644 --- a/src/carquinyol/indexstore.py +++ b/src/carquinyol/indexstore.py @@ -59,27 +59,6 @@ _QUERY_VALUE_MAP = { } -class DateRangeProcessor (xapian.ValueRangeProcessor): - """ - Xapian ValueRangeProcessor for dates given in locale-specific format. - Returns Unix timestamps as values. - """ - - def __init__(self, value_no): - self._value_no = value_no - xapian.ValueRangeProcessor.__init__(self) - - def __call__(self, begin, end): - try: - # TODO: more flexible parsing - e.g. two-digit vs. four-digit - # year numbers - return (self._value_no, - str(time.mktime(time.strptime(begin, "%x"))), - str(time.mktime(time.strptime(end, "%x")))) - except ValueError: - return (xapian.BAD_VALUENO, begin, end) - - class TermGenerator (xapian.TermGenerator): def index_document(self, document, properties): @@ -141,8 +120,6 @@ class QueryParser (xapian.QueryParser): for name, prefix in _QUERY_TERM_MAP.items(): self.add_prefix(name, prefix) - self.add_valuerangeprocessor(DateRangeProcessor(_VALUE_TIMESTAMP)) - def _parse_query_term(self, name, prefix, value): if isinstance(m_value, list): subqueries = [self._parse_query_term(name, prefix, word) |