Download the PHP package madewithlove/elasticsearcher without Composer
On this page you can find all versions of the php package madewithlove/elasticsearcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download madewithlove/elasticsearcher
More information about madewithlove/elasticsearcher
Files in madewithlove/elasticsearcher
Package elasticsearcher
Short Description Wrapper on top of the ElasticSearch PHP SDK which allows easier index/document/query management.
License MIT
Informations about the package elasticsearcher
elasticsearcher
This agnostic package is a lightweight wrapper on top of the Elasticsearch PHP client. Its main goal is to allow for easier structuring of queries and indices in your application. It does not want to hide or replace functionality of the Elasticsearch PHP client.
Installation
Installation of the latest version is easy via composer:
Versions
Elasticsearch | Elasticsearcher |
---|---|
>= 7.0 | >= 0.7 |
>= 5.0 | >= 0.5 |
>= 2.0 | >= 0.4 |
>= 1.0, < 2.0 | 0.3 |
Features
Query class
Structure queries inside a class for clearer oversight in your application.
Query with custom/re-usable fragments
Move re-occuring or complex fragments of your query or index to a separate class.
Query with custom result parsing
Perform actions on the response from Elasticsearch before the Query returns the results. It can be used for converting the Elasticsearch documents into models/entities from your ORM. Re-use it in multiple queries.
Indices management
Documents management
Cluster Health
Sometimes when you're re-indexing your ES data, you might have some issues between your index recreation and indexing your data. That's because ES can take a bit longer to recreate your indexes, causing your reindex task to fail - we are talking about microseconds here. You can find some references here and here.
In order to avoid this, we built this helper in the ElasticSearcher class to check the cluster health. You can use like this:
Place this in your reindex command between your index creation and the data indexing.
Attention: If you're running a single ES node, you'll need to configure your elasticsearch number_of_replicas
setting to 0
. However, we highly recommend you to use at least 2 nodes.
Access to Elasticsearch client
The package does not and will not try to implement everything from the Elasticsearch client. Access to the client is always possible.
Usage
More usage in the examples and documentation.
Documentation
- Index management
- Document management
- Query building (search)
- Result parsing (after search)
- Re-useable fragments