1๐
โ
If i correctly understand you, all you need is to set search indexes without html tags?
We solved that problem this way:
class PostIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(model_attr='text', use_template=True, document=True)
and in template (search/indexes/blogs/post_test.html
) we just used striptags
filter
{{ object.content|striptags }}
After that you need to build_schema
and rebuild_index
. Now it search correctly without tags.
๐คAndrey Nelubin
Source:stackexchange.com