Django search engine for tempates

I have a Django application that contains an accompanying user guide. The contents of the page for the user guide are stored in the templates directory. Haystack seems to be the most popular Django search engine, but it is only recommended for use in model data and does not seem to provide template indexing.

What is the best way to index the contents of a Django template for search? I could create a model that stores the mapped templates and index using Haystack. Is there software that does this already? Or any alternative ways to do this? Any solution needs should preferably include the displayed content (i.e., they can’t just index the templates directly from the disk). I also want to avoid any external search engines supported by ads, such as Google Custom Search and Django integration.

Any suggestions would be greatly appreciated, thanks.

+4
source share
1 answer

haystack_static_pages is made specifically for this purpose.

The application is designed to crawl and index specified displayed pages on your own site. You configure URLs or URL names, and then use the management command to crawl your site.

It is worth noting a few things about this. Haystack is pretty closely related to Django's ORM, so haystack_static_pages makes adding a model for static content, and then dumps the content into the model as a precursor to indexing. It also seems to be developed around version 1.x of Haystack.

+1
source

All Articles