PHPackages                             samman/yii2-solr - 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. samman/yii2-solr

ActiveYii2-extension[Search &amp; Filtering](/categories/search)

samman/yii2-solr
================

Yii2 SOLR (Search Engine) Extension

0.1.0(3y ago)251PHPPHP &gt;=7.4

Since Mar 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Mazen-Al-Samman/yii2-solr)[ Packagist](https://packagist.org/packages/samman/yii2-solr)[ RSS](/packages/samman-yii2-solr/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

 Yii2 SOLR
===========

[](#----yii2-solr)

 Yii2 Package for SOLR active query.

[![Yii2 Framework](https://camo.githubusercontent.com/f54fd2401bea5ad8520d3d65feda9fd2cef0e9157a0d6f29cf94067dba341954/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f596969322d4672616d65776f726b2d7265642e737667)](https://camo.githubusercontent.com/f54fd2401bea5ad8520d3d65feda9fd2cef0e9157a0d6f29cf94067dba341954/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f596969322d4672616d65776f726b2d7265642e737667)

### BASIC FEATURES

[](#basic-features)

- Create new collection
- Drop existing collection
- Define the collection schema
- Index the collection data
- Query to SOLR based on Yii2 Active Query syntax

---

### INSTALLATION

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require samman/yii2-solr
```

or add

```
"samman/yii2-solr": "*"
```

to the require section of your `composer.json` file.

In your `main-local.php` you should add the following

```
'solr' => [
   'class' => \Samman\solr\SolrHelper::class,
   'collection' => '{collectionName}',
   'port' => 8983,
   'url' => 'http://localhost',
   'schemaFilesPath' => 'path/to/schema/'
]
```

To define the collection schema, create a new file in your `schema path` mentioned in the main local with, and the file name will be `{collectionName}.php`

Replce the `{collectionName}` with you collection name mentioned in `main-local.php`

Your Schema file should be as the following

```
