Download the PHP package triadev/laravel-elasticsearch-dsl without Composer
On this page you can find all versions of the php package triadev/laravel-elasticsearch-dsl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download triadev/laravel-elasticsearch-dsl
More information about triadev/laravel-elasticsearch-dsl
Files in triadev/laravel-elasticsearch-dsl
Package laravel-elasticsearch-dsl
Short Description A service provider for laravel with a fluent elasticsearch query and aggregation dsl.
License MIT
Informations about the package laravel-elasticsearch-dsl
laravel-elasticsearch-dsl
A service provider for laravel with a fluent elasticsearch query and aggregation dsl.
Supported laravel versions
Supported elasticsearch versions
Main features
- Query (TermLevel, Fulltext, Geo, Compound, Joining, Specialized, InnerHit)
- Aggregation (Bucketing, Metric, Pipeline)
- Suggestion
Installation
Composer
composer require triadev/laravel-elasticsearch-dsl
Application
The package is registered through the package discovery of laravel and Composer.
Once installed you can now publish your config file and set your correct configuration for using the package.
This will create a file .
Configuration
Key | Env | Value | Default |
---|---|---|---|
index | LARAVEL_ELASTICSEARCH_DSL_INDEX | STRING | default_index |
metrics.enabled | LARAVEL_ELASTICSEARCH_DSL_METRICS | BOOL | false |
metrics.buckets.search | --- | ARRAY | array of buckets in milliseconds |
metrics.buckets.suggest | --- | ARRAY | array of buckets in milliseconds |
Metrics
Metrics are generated with the package: LaravelPrometheusExporter
Detailed configuration options are documented in the readme of the package.
The following metrics are generated as long as :
Namespace: triadev_laravel_elasticsearch_dsl
Histogram
Name | Handler | Description |
---|---|---|
query_duration_milliseconds | search | execution time of search query |
query_duration_milliseconds | suggest | execution time of suggestion query |
Usage
This package offers a dsl for elasticsearch. The entry point for each query / aggregation is a facade.
Triadev\Es\Dsl\Facade\ElasticDsl;
Each query / aggregation returns an object containing the search result and aggregation.
Triadev\Es\Dsl\Model\SearchResult
Bool
For every query that is based on bool, the bool status can be changed.
Default bool state: must
Nested bool query
A nested query is realized with .
TermLevel
matchAll, exists, fuzzy, ids, prefix, range, regexp, term, terms, type, wildcard
Fulltext
match, matchPhrase, matchPhrasePrefix, multiMatch, queryString, simpleQueryString, commonTerms
Geo
geoBoundingBox, geoDistance, geoPolygon, geoShape
Compound
functionScore, constantScore, boosting, disMax
Joining
nested, hasChild, hasParent
Specialized
moreLikeThis
InnerHit
nestedInnerHit, parentInnerHit
Individual index and type
To set an individual index or type per query you have two overwrite methods.
Aggregation
Bucketing, Metric, Pipeline
Suggestions
term, phrase, completion
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
- Christopher Lorke
- All Contributors
Other
Project related links
License
The code for laravel-elasticsearch-dsl is distributed under the terms of the MIT license (see LICENSE).
All versions of laravel-elasticsearch-dsl with dependencies
ext-json Version *
elasticsearch/elasticsearch Version ^6.0
laravel/framework Version 5.5.* || 5.6.* || 5.7.*
ongr/elasticsearch-dsl Version ^6.0
triadev/laravel-elasticsearch-provider Version ^3.0
triadev/laravel-prometheus-exporter Version ^1.6