fahlgrendigital/packages-statamic-algolia-support
最新稳定版本:v1.0.3
Composer 安装命令:
composer require fahlgrendigital/packages-statamic-algolia-support
包简介
Support for the Algolia driver in Statamic applications.
README 文档
README
Add helpful support classes for working with the Algolia driver in Statamic applications.
Installation
$ composer require fahlgrendigital/packages-statamic-algolia-support
Publish
$ php artisan vendor:publish --tag=statamic-algolia-support-config
Usage
This package focuses on a few different areas of support for the Algolia driver in Statamic applications:
- Transformers
- Index building
- Index importing
Transformers
This package offers three transformers designed for handling complex data types in Statamic.
- CollectionTransformer
- DateTransformer
- MarkupTransformer
CollectionTransformer
This transformer currently transformers a collection object into the handle. A common use case for this field is configuring it as a facet in your Algolia index for filtering.
DateTransformer
This transformer currently transformers a date object into a formatted date string using the following format: Y-m-d H:i:s.
MarkupTransformer
This transformer supports the following field types within Statamic:
- Bard
- Textarea
Indexes
This package offers a simple index builder for creating Algolia indexes in your Statamic application. You can configure a laravel filesystem disk to store your indexes in. This is useful for keeping your indexes in sync across multiple algolia environments. Statamic will automagically handle saving CRUD operations for configured index sources in Algolia, and the index builder is designed to handle cases where you want to do an entire index update within Algolia.
Commands
$ php artisan algolia:search-index:build-file {index} -T json/csv -D --json-stats
{index}- The index to build.-T- The type of file to build. Options arejsonorcsv.-D- Whether to do a dry run.--json-stats- Whether to output the stats in for a JSON index export (max, min, avg size).
$ php artisan algolia:build-computed-indexes
This command loops through the configured compound indexes in your config/statamic-algolia-support.php file and builds them.
Example
'computed_indexes' => [ 'my_index' => ['first_index', 'second_index'], ]
统计信息
- 总下载量: 186
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-30