diff --git a/xapian_backend.py b/xapian_backend.py index 5a6e55a..dea4954 100755 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -429,8 +429,9 @@ def add_datetime_to_document(termpos, prefix, term, weight): # `django_id` is an int and `django_ct` is text; # besides, they are indexed by their (unstemmed) value. if field['field_name'] == 'django_id': - value = int(value) - value = _term_to_xapian_value(value, field['type']) + value = str(value) + value = _term_to_xapian_value(value, 'text') + document.add_term(TERM_PREFIXES[field['field_name']] + value, weight) document.add_value(field['column'], value)