PHPackages                             klaasie/scout-solr-engine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. klaasie/scout-solr-engine

ActiveLibrary[Search &amp; Filtering](/categories/search)

klaasie/scout-solr-engine
=========================

An Apache Solr driver for laravel scout

V3.0.0(2y ago)49.4k3[4 PRs](https://github.com/Klaasie/laravel-scout-solr-engine/pulls)MITPHPPHP ^8.0

Since Sep 11Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Klaasie/laravel-scout-solr-engine)[ Packagist](https://packagist.org/packages/klaasie/scout-solr-engine)[ RSS](/packages/klaasie-scout-solr-engine/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (6)Versions (16)Used By (0)

Laravel Scout Apache Solr driver
================================

[](#laravel-scout-apache-solr-driver)

[![GitHub issues](https://camo.githubusercontent.com/aa2a463f77afa4659722c2e9ee3324f9e9d88e2cfbfbd22f5968743513a014c1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4b6c61617369652f6c61726176656c2d73636f75742d736f6c722d656e67696e65)](https://github.com/Klaasie/laravel-scout-solr-engine/issues)[![Latest Stable Version](https://camo.githubusercontent.com/57974895ead503b42cda3bfa45ecc62c3feaca7b4ed6f67b40282dd98cb9fcc9/687474703a2f2f706f7365722e707567782e6f72672f6b6c61617369652f73636f75742d736f6c722d656e67696e652f76)](https://packagist.org/packages/klaasie/scout-solr-engine)[![License](https://camo.githubusercontent.com/ca696ed22a3a5050dd8d38a1da74c06815dab9a6e7bbf9bdf658b6fe89c0b856/687474703a2f2f706f7365722e707567782e6f72672f6b6c61617369652f73636f75742d736f6c722d656e67696e652f6c6963656e7365)](https://packagist.org/packages/klaasie/scout-solr-engine)[![PHP Version Require](https://camo.githubusercontent.com/94af317ff9632ee6ceb6aa086a7638ba05c5ecd5eaa7778453a214fffbc367d5/687474703a2f2f706f7365722e707567782e6f72672f6b6c61617369652f73636f75742d736f6c722d656e67696e652f726571756972652f706870)](https://packagist.org/packages/klaasie/scout-solr-engine)

This package provides a basic implementation of the Apache Solr search engine within Laravel Scout.

Installation
------------

[](#installation)

`composer require klaasie/scout-solr-engine`

config
------

[](#config)

This package provides a config file that can be modified using .env variables.
You can initialize your own config file with:

`php artisan vendor:publish --provider="Scout\Solr\ScoutSolrServiceProvider"`

### scout:index

[](#scoutindex)

By default, Solr doesn't allow indexes (cores) to be created without providing the proper folders and files on the file system first. However, if a default config set is set up in the Solr instance this becomes possible through the API.
The `scout:index` command will only work if the Solr instance is properly configured and the config files has the corresponding name for the config set folder. For more information, see [https://solr.apache.org/guide/8\_9/config-sets.html#config-sets](https://solr.apache.org/guide/8_9/config-sets.html#config-sets)

### Cores (indexes)

[](#cores-indexes)

Within the config file a core (index) is not provided. The engine will determine which core to connect to using the `searchableAs()` method on the model.

Alternatively, if a specific model is on a different Solr instance, another configuration can be provided for this model. It's important for the configuration key to match the `searchableAs()` of the model.

[Solarium](https://github.com/solariumphp/solarium)
---------------------------------------------------

[](#solarium)

This package uses [solarium/solarium](https://github.com/solariumphp/solarium) to handle requests to the solr instance. This app is meant to be a simple implementation of the laravel/scout engine. For complex queries to the solr instance I would recommend initializing your own Solarium client and use that package. Visit  to view the documentation of the solarium package.

For convenience, any unknown methods used on the engine will be forwarded to the solarium client.

```
$model = new \App\Models\SearchableModel();

/** @var \Scout\Solr\Engines\SolrEngine $engine */
$engine = app(\Laravel\Scout\EngineManager::class)->engine();
$select = $engine->setCore($model)->createSelect();
$select->setQuery('*:*');
$result = $engine->select($select, $engine->getEndpointFromConfig($model->searchableAs())); // getEndpointFromConfig() is only necessary when your model does not use the default solr instance.
```

Events
------

[](#events)

The Solr Engine dispatches several events allowing you to hook into specific points in the engine.

EventUsageScout\\Solr\\Events\\BeforeSelectContains the Solr `Solarium\QueryType\Select\Query\Query` object and Scout `Builder` object. This event allows you to create complex queries using the Solarium package.Scout\\Solr\\Events\\BeforeSelectContains the Solr `Solarium\QueryType\Select\Result\Result` object and `Model` object. This event allows you to create complex queries using the Solarium package.Example
-------

[](#example)

This repository provides an example laravel app showcasing the functionality of this package.
Please refer to the [README.md](example/README.md) of the example app for information on how to get it started.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~235 days

Total

12

Last Release

794d ago

Major Versions

0.6.0 → v1.0.02021-10-02

V1.1.0 → V2.0.02023-01-29

v2.1.0 → V3.0.02024-04-30

PHP version history (2 changes)0.1.0PHP ^7.4|^8.0

V2.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3026259?v=4)[Klaas Poortinga](/maintainers/Klaasie)[@Klaasie](https://github.com/Klaasie)

---

Top Contributors

[![Klaasie](https://avatars.githubusercontent.com/u/3026259?v=4)](https://github.com/Klaasie "Klaasie (71 commits)")[![drzippie](https://avatars.githubusercontent.com/u/239421?v=4)](https://github.com/drzippie "drzippie (1 commits)")

---

Tags

searchlaravelsolrdriverapacheenginescout

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/klaasie-scout-solr-engine/health.svg)

```
[![Health](https://phpackages.com/badges/klaasie-scout-solr-engine/health.svg)](https://phpackages.com/packages/klaasie-scout-solr-engine)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
