steadlane/silverstripe-searchify

用 Searchify(又称 IndexTank)替换 SilverStripes 内置的搜索功能

安装: 0

依赖: 0

建议者: 0

安全: 0

星星: 1

关注者: 2

分支: 1

类型:silverstripe-module

dev-master 2016-12-06 06:56 UTC

This package is auto-updated.

Last update: 2024-09-12 21:47:23 UTC


README

Build Status Code Climate

简介

此模块是 SilverStripes 内置搜索功能的完整替代品。

它利用了 Searchify 的优势

安装

此模块仅支持通过 composer 安装

composer require steadlane/silverstripe-searchify
  • 之后运行 /dev/build,并运行 ?flush=1 以确保 SilverStripe 能够识别此模块
  • 然后运行 /dev/tasks/SearchifyIndexAllTask 以自动索引你 SiteTree 中找到的任何公开可见和可搜索的页面

特性

  • 当页面发布时自动索引页面
    • 将尊重 CMS 页面选项“显示在搜索中”
  • 从索引中删除已取消发布或“显示在搜索中”已禁用的页面
  • 可自定义页面黑名单(例如,您可能不希望索引 ErrorPage 类型的页面)
  • 内容发现
    • 通常,自定义 PageTypes 将定义自定义的 HTMLText 字段,如果启用 discover,则此模块将检测这些字段并将它们添加到索引中,因此它们也可以被搜索

所需配置

您只需要在 mysite/_config.php 中定义 Searchify 提供的 API URL

define('SEARCHIFY_API_URL', 'http://:example@api.searchify.com');

可选配置

searchify/_config/searchify.yml:

Searchify:
  settings:
    index: MyIndex # The name of the index to use
    make_index: true # If the index doesn't exist, create it
    discover: true # If set to true, this module will adapt to any PageType it is given. For more information see the README.md
    page_blacklist: # Allows you to blacklist certain Page Types, eg you wouldn't want to index an ErrorPage
      - ErrorPage

贡献

如果您觉得可以在任何方面改进此模块,请不要犹豫,提交 PR 以供审查。

错误/问题

请使用我们的 问题跟踪器 报告错误或问题。

许可

此模块在 BSD-3 Clause 许可下分发。