You can choose which field will be used as the objectID. The field should be unique and can be a string or integer. By default, we use the pk field of the model.
If you want to process a field before indexing it (e.g. capitalizing a Contact’s name),
or if you want to index a related object’s
attribute, you need to define proxy methods for these fields.
With this configuration, you can search for a Contact using its Account names
You can use the associated account_ids at search-time to fetch more data from your
model (you should only proxy the fields relevant for search to keep your records’ size
as small as possible)
Index settings
We provide many ways to configure your index allowing you to tune your overall index relevancy.
All the configuration is explained on our doc.
It is possible to temporarily disable the auto-indexing feature using the disable_auto_indexing context decorator:
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fromalgoliasearch_django.decoratorsimportdisable_auto_indexing# Used as a context manager
withdisable_auto_indexing():MyModel.save()# Used as a decorator
@disable_auto_indexing():my_method()# You can also specifiy for which model you want to disable the auto-indexing
withdisable_auto_indexing(MyModel):MyModel.save()MyOtherModel.save()