I have a tutorial site [say JavaScript tutorial] with multiple webpages. I want to implement a search functionality for this site so that i can search for keywords and filter links [say query=callback. So filter links/pages that i have this keyword] I have already implemented haystack+woosh this can index all the models that i have in my models.py in Django. I want to implement indexing for the webpages so that i can search through them. I know elasticsearch [i will implement models in elasticsearch as well instead of woosh. This i know how to do] can be used for this. I was looking for specific example for how to index STATIC PAGES in a site to search through them. I have gone through some tutorial and git code but don't have a clear understanding of how to implement this. Can anyone please provide links/ tutorials on how to implement elasticsearch in django TO INDEX WEBPAGES. Thanks,
1 Answer
there is an extension for haystack that does exactly this: https://github.com/trapeze/haystack-static-pages
It is pretty old and no longer maintained, but you might get it to work with a little extra effort. I think this is a good solution.
Another solution would be to include all text in a simple Content Management System like Wagtail or Mezzanine. In the most basic implementation, you can refactor your static files to templates and just replace the text with placeholders. Wagtail works nicely with haystack.
I hope this helps, Felix