Download the PHP package fareselshinawy/elastic-search without Composer
On this page you can find all versions of the php package fareselshinawy/elastic-search. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fareselshinawy/elastic-search
More information about fareselshinawy/elastic-search
Files in fareselshinawy/elastic-search
Package elastic-search
Short Description elastic-search package provides a seamless integeration of elastic search into laravel appications, desinged to simplify search and indexing functionalities. It offers an easy-to-use interface for managing elastic search queries, along with full support for multi tenant and standard projects.
License MIT
Informations about the package elastic-search
Laravel Elasticsearch Integration Package
The package provides seamless integration with Elasticsearch, supporting multi-tenant architecture and offering an intuitive query builder interface.
Features
- Easy integration with Laravel models
- Built-in multi-tenant support using stancl/tenancy
- Fluent query builder interface
- Automated index management
- Configurable schema mappings
- Relationship syncing support
- Artisan commands for index management
Installation
You can install the package via composer:
If you plan to use multi-tenant features: multi tenant can be extend to other packages be making your own tenant adapter implementing TenantAdapterInterface
Configuration
Publish the configuration file:
Configure your Elasticsearch credentials in your .env
file:
Usage
Model Setup
To make your model searchable with Elasticsearch, add the following methods to your model:
Query Builder Usage
The package provides a fluent interface for building Elasticsearch queries:
Available Query Methods
Term Queries
elasticTerm(field, value, conditionType = 'must')
elasticTermMust(field, value)
elasticTermMustNot(field, value)
elasticTermShould(field, value)
Terms Queries (Arrays)
elasticTerms(field, values, conditionType = 'must')
elasticTermMustIn(field, values)
elasticTermMustNotIn(field, values)
elasticTermShouldIn(field, values)
Match Queries
elasticMatch(field, value, conditionType = 'must')
elasticWhereMatch(field, value)
elasticOrWhereMatch(field, value)
elasticMatchMustNot(field, value)
Wildcard Queries
elasticWildcard(field, value)
elasticWildcardLike(field, value)
elasticWildcardStartWith(field, value)
elasticWildcardEndWith(field, value)
Range Queries
elasticRange(field, from, to)
elasticGreaterOrEqual(field, value)
elasticLessOrEqual(field, value)
Artisan Commands
The package provides several Artisan commands for index management:
Standard Commands
Multi-tenant Commands
For tenant-specific operations, use the --tenantReference
flag:
Multi-tenant Support
The package integrates with stancl/tenancy
for multi-tenant support. Configure tenant-specific settings in the config file:
Security
If you discover any security-related issues, please email [[email protected]] instead of using the issue tracker.
Credits
- [Fares Ashraf Ibrahim Elshinawy]
License
The MIT License (MIT). Please see License File for more information.