triadev / laravel-elasticsearch-config-builder
Elasticsearch config (mappings + settings) builder for laravel.
v1.0.0
2018-09-09 20:21 UTC
Requires
- php: >=7.1
- laravel/framework: ^5.4
Requires (Dev)
- elasticsearch/elasticsearch: ^6.0
- fzaninotto/faker: ~1.4
- mockery/mockery: ~1.0
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-10-22 07:54:14 UTC
README
Elasticsearch config (mappings + settings) builder for laravel.
Supported laravel versions
Supported elasticsearch versions
Main features
- Build mappings
- Build settings
- Multilanguage keys
- Multilanguage indices
- Mapping validation check
Installation
Composer
composer require triadev/laravel-elasticsearch-config-builder
Application
The package is registered through the package discovery of laravel and Composer.
Configuration
Mappings
Directory (i.e. 1.0.0) with elasticsearch config files.
mappings.php (Example)
return [
TYPE => [
'properties' => [
FIELD => [
'type' => TYPE
],
...
],
...
],
...
];
settings.php (Example)
return [ 'refresh_interval' => "30s", 'analysis' => [ 'filter' => [ 'germanStop' => [ 'type' => 'stop', 'stopwords' => '_german_' ] ], 'analyzer' => [ 'exampleAnalyzer' => [ 'type' => 'custom', 'tokenizer' => 'standard', 'filter' => [ 'germanStop' ] ] ] ] ];
translations.php (Example)
return [ 'type' => 'field', 'locales' => [ 'enUS' ], 'fields' => [ 'example.properties.title' ], 'configPerLocale' => [ 'example.properties.title' => [ 'enUS' => [ 'analyzer' => 'exampleAnalyzerEn' ] ] ] ];
Reporting Issues
If you do find an issue, please feel free to report it with GitHub's bug tracker for this project.
Alternatively, fork the project and make a pull request. :)
Testing
- docker-compose -f docker-compose.yml up
- composer test
Contributing
Please see CONTRIBUTING for details.
Credits
Other
Project related links
License
The code for LaravelElasticsearchConfigBuilder is distributed under the terms of the MIT license (see LICENSE).