helsingborg-stad/algolia-index-js-searchpage-addon 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

helsingborg-stad/algolia-index-js-searchpage-addon

Composer 安装命令:

composer require helsingborg-stad/algolia-index-js-searchpage-addon

包简介

https://github.com/helsingborg-stad/algolia-index-js-searchpage-addon

README 文档

README

Replaces search page with a js (instant search) page.

Features

  • Real-time search with Algolia or Typesense
  • Faceted search (filtering) support
  • Pagination
  • Configurable search behavior

Constants

  • ALGOLIA_INDEX_MOUNT_POINT - On what action to run js. Default: get_search_form

Faceting Configuration

Faceting allows users to filter search results by various attributes such as origin site, categories, tags, or custom taxonomies.

Enabling Facets

Faceting is enabled by default. To disable it, use the filter:

add_filter('AlgoliaIndex/FacetingEnabled', '__return_false');

Configuring Facets

Define which attributes should be available for faceting:

add_filter('AlgoliaIndex/Facets', function($facets) {
    return [
        [
            'attribute' => 'origin_site',
            'label' => __('Origin Site', 'text-domain'),
            'enabled' => true
        ],
        [
            'attribute' => 'categories',
            'label' => __('Categories', 'text-domain'),
            'enabled' => true
        ],
        [
            'attribute' => 'tags',
            'label' => __('Tags', 'text-domain'),
            'enabled' => true
        ]
    ];
});

Important: Facet attributes must be configured in your Algolia index settings as "Attributes for faceting" for them to work properly.

Origin Site Faceting

The origin_site facet is particularly useful when multiple WordPress sites share the same Algolia index. It allows users to filter results by their source site.

Filters

  • AlgoliaIndex/SearchConfig - Modify the search configuration
  • AlgoliaIndex/SearchParams - Modify search parameters
  • AlgoliaIndex/SearchAsYouType - Enable/disable search as you type (default: true)
  • AlgoliaIndex/FacetingEnabled - Enable/disable faceting (default: true)
  • AlgoliaIndex/Facets - Configure available facets (default: empty array)

统计信息

  • 总下载量: 17.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 3
  • 开发语言: TypeScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固