Download the PHP package ibraimv/laravel-solr-integration without Composer
On this page you can find all versions of the php package ibraimv/laravel-solr-integration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ibraimv/laravel-solr-integration
More information about ibraimv/laravel-solr-integration
Files in ibraimv/laravel-solr-integration
Package laravel-solr-integration
Short Description A Laravel package for seamless Solr integration
License MIT
Informations about the package laravel-solr-integration
Solr Integration for Laravel
This package provides an easy-to-use Solr client for Laravel, allowing you to interact with an Apache Solr server. It facilitates document addition, bulk operations, and search queries, making it simple to integrate Solr with Laravel applications.
Installation
Step 1: Install the Package
Install via Composer:
Step 2: Publish Configuration
Publish the Solr configuration file:
Step 3: Configure Environment Variables
Publish the Solr configuration file:
Usage
Basic usage
Overriding Default Configuration Values
When creating an instance of SolrClient, you can override the default values for base_uri, default_collection, and default_params. This is useful if you need to use a separate Solr configuration for specific methods without affecting the global configuration.
Methods
-
addDocument(array $document): Add a single document to Solr.
-
bulkAddDocuments(array $documents): Add multiple documents at once.
-
deleteSingleDocument(string $value, string $field = 'id'): Delete a document by a specific field.
-
bulkDeleteDocuments(array $criteria): Delete multiple documents based on query criteria or field values.
- search(string $query, array $options = []): Perform a search query with customizable options.
Configuration Options
-
base_uri: The base URL of the Solr server.
-
default_collection: The default Solr collection to use.
- default_params: Default search parameters.
Exception Handling
All requests are wrapped in error handling. In case of failure, exceptions will be logged, and the error message can be found in the Laravel error logs.
License
This package is open-source and licensed under the MIT License.
All versions of laravel-solr-integration with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0