craftpulse / craft-typesense
与 Typesense 同步的 Craft 插件
5.5.3.1
2024-08-26 16:57 UTC
Requires
- php: ^8.0.2
- craftcms/cms: ^5.0.0
- illuminate/collections: ^v10.42.0
- nystudio107/craft-plugin-vite: ^5.0.0
- php-http/guzzle7-adapter: ^1.0.0
- typesense/typesense-php: ^4.7.0
Requires (Dev)
- codeception/codeception: ^5.0
- craftcms/phpstan: dev-main
- vlucas/phpdotenv: ^3.0
- dev-develop-v4
- v5.x-dev
- 5.5.3.1
- 5.5.3
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.3
- 5.4.2
- 5.4.1
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.0
- 5.0.1
- 5.0.0
- v4.x-dev
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0-beta.3
- 4.0.0-beta.2
- 4.0.0-beta.1
- v3.x-dev
- 1.0.0-beta.14
- 1.0.0-beta.13
- 1.0.0-beta.12
- 1.0.0-beta.11
- 1.0.0-beta.10
- 1.0.0-beta.9
- 1.0.0-beta.8
- 1.0.0-beta.7
- 1.0.0-beta.6
- 1.0.0-beta.5
- 1.0.0-beta.4
- 1.0.0-beta.3
- 1.0.0-beta.2
- 1.0.0-beta.1
- dev-develop-v5
- dev-feature/multi-language
- dev-feature/save-queue
- dev-develop
- dev-dependabot/npm_and_yarn/docs/http-cache-semantics-4.1.1
- dev-renovate/configure
- dev-dependabot/npm_and_yarn/buildchain/minimist-1.2.8
- dev-dependabot/npm_and_yarn/buildchain/vite-2.9.13
- dev-feature/connection-improvements
- dev-feature/cluster
- dev-feature/config-collection-documents
- dev-dependabot/npm_and_yarn/buildchain/follow-redirects-1.14.9
- dev-feature/settings
This package is auto-updated.
Last update: 2024-08-26 16:59:26 UTC
README
与 Typesense 同步的 Craft 插件。
需求
此插件需要 Craft CMS 4.0.0 或更高版本。
安装
要安装此插件,请按照以下说明操作。
-
打开您的终端并转到您的 Craft 项目
cd /path/to/project
-
然后告诉 Composer 加载插件
composer require craftpulse/craft-typesense
-
在控制面板中,转到设置 → 插件,并点击 Typesense 的“安装”按钮。
Typesense 概述
在设置好配置文件以创建哪些索引后,您可以在添加/编辑/删除元素后立即开始。如果您想同步所有内容,可以转到控制面板中的 Typesense 部分,并在集合内同步所有内容。
配置 Typesense
将 config.php 复制粘贴到您的配置文件夹,并命名为 typesense.php。添加您想关联的索引、字段和查询以开始。以下是一个博客部分的示例
'collections' => [ // CONTENT \percipiolondon\typesense\TypesenseCollectionIndex::create( [ 'name' => 'blog', 'section' => 'blog.blog', //section handle + entry type handle 'fields' => [ [ 'name' => 'title', 'type' => 'string', 'sort' => true, ], [ 'name' => 'slug', 'type' => 'string', 'facet' => true ], [ 'name' => 'handle', 'type' => 'string', ], [ 'name' => 'post_date_timestamp', 'type' => 'int32', ], ], 'default_sorting_field' => 'post_date_timestamp', // can only be an integer, 'resolver' => static function(\craft\elements\Entry $entry) { return [ 'id' => (string)$entry->id, 'title' => $entry->title, 'handle' => $entry->section->handle, 'slug' => $entry->slug, 'post_date_timestamp' => (int)$entry->postDate->format('U') ]; } ] ) ->elementType(\craft\elements\Entry::class) ->criteria(function(\craft\elements\db\EntryQuery $query) { return $query->section('blog'); }), ]
默认情况下,Craft CMS 不会在计划发布的帖子发布后更新状态时触发事件。因此,我们提供了一个控制台命令,您可以将它附加到 cron 作业中。该命令检查今天是否有计划发布的条目,以及是否在那天之后更新了它们
./craft typesense/default/update-scheduled-posts
使用 Typesense
-请在此处插入文本-
Typesense 路线图
一些要完成的事项和潜在功能的想法
- 发布它
由 craftpulse 提供