1

I define an index as shown below, zero-padding the order_key integerfield as specified in the doc.

class PlaceIndex(SearchIndex):
    text = CharField(document=True, use_template=True)
    order_key = IntegerField(model_attr='order_key')

    def prepare_order_key(self, obj):
        return '%08d' % obj.order_key

site.register(Place, PlaceIndex)

When I run python manage.py rebuild_index, I can order_by my SearchQuerySet properly, but as soon as I run python manage.py update_index, a SearchQuerySet with an order_by always returns an empty list.

What's wrong?

Thanks

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
jul
  • 36,404
  • 64
  • 191
  • 318

0 Answers0