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

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

Maintainers

Package info

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

Language:TypeScript

Type:wordpress-plugin

pkg:composer/helsingborg-stad/algolia-index-js-searchpage-addon

Statistics

Installs: 17 272

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 6

3.6.12 2026-01-14 09:38 UTC

This package is auto-updated.

Last update: 2026-03-04 22:48:25 UTC


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)