承接 helsingborg-stad/algolia-index 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

helsingborg-stad/algolia-index

Composer 安装命令:

composer require helsingborg-stad/algolia-index

包简介

Index wordpress site content to algolia.

README 文档

README

Manages algolia index (with ms-support and mixed indexes). This is intended to be used by delvelopers. This plugin provide the following set of features:

  • Replaces algolia search on the front-end with algolia.
  • Index all public searchable posts on post update or creation.
  • WpCLI jobs to bulk index all posts on the site.
  • Support mixed indices (multiple wordpress sites in the same index).
  • Large record splitting (content field).
  • Implements "needs update" check before querying algolia, to save costly updates. The functionality is not implemented on split records.

Installation

  1. Install with: "composer require helsingborg-stad/algolia-index"
  2. Run composer install inside the plugin.
  3. Add required definitions of constants.
  4. Run wp-cli job "wp algolia-index build"

Constants

  • define('ALGOLIAINDEX_APPLICATION_ID', 'ALGOLIAAPPID'); - REQUIRED
  • define('ALGOLIAINDEX_API_KEY', 'ALGOLIAAPIKEY'); - REQUIRED
  • define('ALGOLIAINDEX_INDEX_NAME', 'INDEX'); - OPTIONAL
  • define('ALGOLIAINDEX_PUBLIC_API_KEY', 'INDEX'); - OPTIONAL, Required by js searchpage addon

Filters

  • AlgoliaIndex/ShouldIndex: Add more rules to the should index function (removal not possible).
  • AlgoliaIndex/Record: What data to send to algolia.
  • AlgoliaIndex/Compare: What fields to compare to determine if a post has been updated.
  • AlgoliaIndex/SearchableAttributes: What attriubutes in record to be searchable.
  • AlgoliaIndex/GeneratedIndexName: Filter for the autogenerated index name.
  • AlgoliaIndex/RecordToLarge: Turn off record to large repoting by returning false. To disable record splitting. Only compatbile with business plans, not reccommended!.
  • AlgoliaIndex/IndexablePostTypes: What posttypes to index.
  • AlgoliaIndex/HitsPerPage: Number of hits per page.
  • AlgoliaIndex/AttributesToSnippet: What attributes to snippet.
  • AlgoliaIndex/SnippetEllipsisText: Suffix for snippet.
  • AlgoliaIndex/BackendSearchActive: Send false to disable backend search.
  • AlgoliaIndex/IndexablePostStatuses: What post statuses to allow for index.
  • AlgoliaIndex/Provider/Factory: What search database providers are avalible - provider name as key and lambda returning an AbstractProvider as value.

Actions

  • AlgoliaIndex/IndexPostId: Trigger reindex on a post id.
  • AlgoliaIndex/SendSettings: Send settings.

WP CLI

  • wp algolia-index build: Index all pages/posts on site.

WP CLI Arguments

  • To clear index* before build, add flag --clearindex=true.
  • To send required search configuration before build, add flag --settings=true.
  • To index using a different search provider (then the active one), add flag --provider={provider-name} (eg. algolia)

Example

wp site list --field=url --public=1 --archived=0 --deleted=0 --allow-root | xargs -n1 -I % wp algolia-index build --settings=true --url=% --allow-root

  • This action is not fully compatible with multiple sites in one shared index! Sites that share the same index will be cleared but not reindexed.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固