Skip to content

Commit 54022d6

Browse files
committed
Initial commit
0 parents  commit 54022d6

File tree

9 files changed

+590
-0
lines changed

9 files changed

+590
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/vendor
2+
/.env
3+
composer.phar
4+
composer.lock
5+
.DS_Store
6+
Thumbs.db
7+
/phpunit.xml
8+
/build

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Erick Tamayo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Laravel Scout Elasticsearch Driver
2+
3+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
4+
5+
This package makes is the [Elasticsearch](https://www.elastic.co/products/elasticsearch) driver for Laravel Scout.
6+
7+
## Contents
8+
9+
- [Installation](#installation)
10+
- [Usage](#usage)
11+
- [Credits](#credits)
12+
- [License](#license)
13+
14+
## Installation
15+
16+
You can install the package via composer:
17+
18+
``` bash
19+
composer require tamayo/laravel-scout-elastic
20+
```
21+
22+
You must add the Scout service provider and the package service provider in your app.php config:
23+
24+
```php
25+
// config/app.php
26+
'providers' => [
27+
...
28+
Laravel\Scout\ScoutServiceProvider::class,
29+
...
30+
ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
31+
],
32+
```
33+
34+
### Setting up Elasticsearch configuration
35+
You must have a Elasticsearch server up and running with the index you want to use created
36+
37+
If you need help with this please refer to the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)
38+
39+
After you've published the Laravel Scout package configuration:
40+
41+
```php
42+
// config/scout.php
43+
// Set your driver to elasticsearch
44+
'driver' => env('SCOUT_DRIVER', 'elasticsearch'),
45+
46+
...
47+
'elasticsearch' => [
48+
'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
49+
'hosts' => [
50+
env('ELASTICSEARCH_HOST', 'http://localhost'),
51+
],
52+
],
53+
...
54+
```
55+
56+
## Usage
57+
58+
Now you can use Laravel Scout as described in the [official documentation](https://laravel.com/docs/5.3/scout)
59+
## Credits
60+
61+
- [Erick Tamayo](https://github.com/ericktamayo)
62+
- [All Contributors](../../contributors)
63+
64+
## License
65+
66+
The MIT License (MIT).

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "tamayo/laravel-scout-elastic",
3+
"description": "Elastic Driver for Laravel Scout",
4+
"keywords": ["laravel", "scout", "elasticsearch", "elastic"],
5+
"require": {
6+
"php": ">=5.6.4",
7+
"laravel/scout": "^5.0",
8+
"elasticsearch/elasticsearch": "^5.0"
9+
},
10+
"require-dev": {
11+
"fzaninotto/faker": "~1.4",
12+
"mockery/mockery": "0.9.*",
13+
"phpunit/phpunit": "~5.0"
14+
},
15+
"autoload": {
16+
"psr-4": {
17+
"ScoutEngines\\Elasticsearch\\": "src/"
18+
}
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"ScoutEngines\\Elasticsearch\\Test\\": "tests"
23+
}
24+
},
25+
"suggest": {
26+
"elasticsearch/elasticsearch": "Required to use the Elasticsearch engine (^5.0)."
27+
},
28+
"extra": {
29+
"laravel": {
30+
"providers": [
31+
"ScoutEngines\\Elasticsearch\\ElasticsearchProvider"
32+
]
33+
}
34+
},
35+
"minimum-stability": "dev",
36+
"prefer-stable": true
37+
}

phpunit.xml.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Package Test Suite">
15+
<directory suffix=".php">./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>

0 commit comments

Comments
 (0)