【问题标题】:Django-haystack search static contentDjango-haystack 搜索静态内容
【发布时间】:2017-02-04 00:02:28
【问题描述】:

我的 Django 1.10 应用程序提供了使用 Haystack + Elastic Search 的搜索功能。它适用于模型数据,但我也需要让它适用于静态内容(基本上是 HTML 文件)。

我正在考虑从 HTML 文件(BeautifulSoup?)中删除内容并将它们保存到数据库中,这样可以索引模板内容。

我发现这个模块完全符合我的需要,但似乎已被弃用:

https://github.com/trapeze/haystack-static-pages

那么,让 haystack 找到 HTML 页面中包含的内容的最佳方法是什么?

【问题讨论】:

    标签: python django django-haystack static-files html-content-extraction


    【解决方案1】:

    我分叉了模块 haystack-static-pages 并根据我的需要对其进行了调整。现在与 Django 1.10 + haystack 2.5 兼容,并支持登录以报废记录页面:)

    更新版本: https://github.com/pisapapiros/haystack-static-pages

    【讨论】:

      【解决方案2】:

      我知道这是一个相当古老的话题,但以防万一其他人来到这里,我已经为 Django 1.11、Haystack 2.8.1 更新了上述库

      https://github.com/nkhumphreys/haystack-static-pages

      (PR加了但是上面的版本暂时没有爱了)

      【讨论】:

        猜你喜欢
        • 2012-04-21
        • 1970-01-01
        • 2014-09-25
        • 2015-06-14
        • 2013-02-12
        • 2014-07-17
        • 2012-12-29
        • 1970-01-01
        • 2011-03-26
        相关资源
        最近更新 更多