helsingborg-stad / algolia-index-js-searchpage-addon
https://github.com/helsingborg-stad/algolia-index-js-searchpage-addon
Installs: 16 625
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 3
Open Issues: 0
Language:TypeScript
Type:wordpress-plugin
pkg:composer/helsingborg-stad/algolia-index-js-searchpage-addon
Requires
- helsingborg-stad/component-library: ^4.0.0
- helsingborg-stad/municipio: ^6.0.0
- helsingborg-stad/wpservice: ^2.0
- helsingborg-stad/wputilservice: ^0.2.44
Requires (Dev)
- carthage-software/mago: ^1.0.0-rc.1
- phpunit/phpunit: ^11.5
- dev-main
- 3.6.2
- 3.6.0
- 3.5.13
- 3.5.11
- 3.5.9
- 3.5.7
- 3.5.5
- 3.5.2
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.26
- 3.3.24
- 3.3.22
- 3.3.21
- 3.3.18
- 3.3.16
- 3.3.15
- 3.3.13
- 3.3.12
- 3.3.11
- 3.3.9
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-release
- dev-feat/typsense-facet-query
- dev-misc/new-build
- dev-refactor/municipio-as-dependency
- dev-vite-migration
- dev-copilot/add-facetting-for-origin-site
- dev-snyk-upgrade-264157f8cc66fc8abffcf377819d2f6a
- dev-fix/corrected-css-class-for-image-removal
- dev-feat/typesense
- dev-fix/message-clarity
- dev-feat/using-blade-outside-of-js-components
- dev-fix/load-textdomain
- dev-feat/adding-alt-text-for-images
- dev-snyk-upgrade-b4ce612e6521c772b9e1d79fce8be166
- dev-snyk-upgrade-c39bc6f4541d3f9407aa6db5df5ad2bd
- dev-feat/removed-images-from-mobile
- dev-feat/install-npm
- dev-fix/corrected-functions
- dev-fix/script-loads-in-too-early
- dev-fix/removing-notices
- dev-3.0/develop
- dev-feature/pagination-fix
- dev-feature/refactor-search-page
- dev-feature/search-result-layout-fix
- dev-3.0/fix/parse-html-entities
- dev-master
This package is auto-updated.
Last update: 2025-11-24 10:18:39 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 configurationAlgoliaIndex/SearchParams- Modify search parametersAlgoliaIndex/SearchAsYouType- Enable/disable search as you type (default: true)AlgoliaIndex/FacetingEnabled- Enable/disable faceting (default: true)AlgoliaIndex/Facets- Configure available facets (default: empty array)