Come on, I've been looking for this for a week.
It is listed in the SearchField API SearchField , which is a superclass of the actual fields in the search index.
SearchField.template_name
Allows you to override the name of the template that will be used in the preparation of the data. By default, data templates for fields are located within your TEMPLATE_DIRS under a road similar to search/indexes/{app_label}/{model_name}_{field_name}.txt . This allows you to override this path (although still within TEMPLATE_DIRS ).
Example:
bio = CharField(use_template=True, template_name='myapp/data/bio.txt')
You can also provide a list of templates, since loader.select_template is used under the hood.
Example:
bio = CharField(use_template=True, template_name=['myapp/data/bio.txt', 'myapp/bio.txt', 'bio.txt'])
user764357
source share