Skip to content

Commit

Permalink
Upgrade to ErickTamayo/laravel-scout-elastic 5.0.0 (#1)
Browse files Browse the repository at this point in the history
* Updating 0.0.1 (ErickTamayo#8)

* fixing config key + updating the Usage on README (ErickTamayo#6)

* Rename ElasticsearchEngineTets.php to ElasticsearchEngineTest.php (ErickTamayo#7)

* Updating 0.0.1 (ErickTamayo#11)

* fixing config key + updating the Usage on README (ErickTamayo#6)

* Rename ElasticsearchEngineTets.php to ElasticsearchEngineTest.php (ErickTamayo#7)

* Update ElasticsearchEngine.php (ErickTamayo#10)

* Updating 0.0.1 (ErickTamayo#14)

* fixing config key + updating the Usage on README (ErickTamayo#6)

* Rename ElasticsearchEngineTets.php to ElasticsearchEngineTest.php (ErickTamayo#7)

* Update ElasticsearchEngine.php (ErickTamayo#10)

* optimized creation of params array for better performance when dealing with huge amount of models (ErickTamayo#13)

* Make stable (ErickTamayo#18) (ErickTamayo#19)

* Bumped Scout version to v2.0.x
Bumped elasticsearch/elasticsearch to v5.0

* Bumped Scout version to 3.0

* Fix config name (ErickTamayo#35)

* v3.0.2

bumping to php 5.6.6 (Earliest version that can support php elasticsearch) (ErickTamayo#48)
`within` now is being taken into account when specified ErickTamayo#31
Now if the record is not found on the db will not throw undefined offset ErickTamayo#36
Implemented orderBy ErickTamayo#46

* Update ElasticsearchProvider.php (ErickTamayo#54)

use `app` instead of `resolve` to make lumen 5.4 compatible.

`app` and `resolve` are identical since 5.4, see https://github.com/laravel/framework/blob/5.4/src/Illuminate/Foundation/helpers.php#L690

* chain `values` method in `map` function (ErickTamayo#66)

In 
```php
    collect($results['hits']['hits'])->map(function ($hit) use ($model, $models) {
            return isset($models[$hit['_id']]) ? $models[$hit['_id']] : null;
        })->filter();
```
would generate some holds which would cause `paginate` results objects rather than list.

* Support for "WHERE IN" searches if array is passed to `where` (ErickTamayo#55)

Right now passing an array results in: "illegal_state_exception: Can't get text on a START_ARRAY"
Solution based on http://stackoverflow.com/a/40737488/7362396

* Execute the callback that can be passed to the Builder in performSearch (ErickTamayo#56)

Context: laravel/scout#111

Implementation analogical to the official AlgoliaEngine implementation: https://github.com/laravel/scout/blob/v3.0.3/src/Engines/AlgoliaEngine.php#L112-L119

* Update ElasticsearchEngine.php (ErickTamayo#51)

Predefine elastic variable.

* Enable Laravel5.5 package Auto-Discovery (ErickTamayo#81)

* Removed count function. Fixes ErickTamayo#80 (ErickTamayo#84)

Since php 7.2, count a number will generate a warning. Because
$results['hits']['total'] is a number we can just compare it to zero.

`if ($results['hits']['total'] === 0)`

* Allow installation with Scout 4 (ErickTamayo#99)

* Compatibility with Scout 5 (ErickTamayo#106)

* Compatibility with Scout 5

No "cross-installation" possible due to changed method signature

Pass around new $builder var

Also: Use getScoutModelsByIds/getScoutKey

Inspired by laravel/scout@4.0...5.0#diff-f2faa85f27580a9b67d73a8a273bfef1 / laravel/scout@9f06b9c

* Remove PHP5 as laravel/scout^5 / laravel5.6 also removed it

* Added support for Laravel Scout 6.0 and 7.0, Laravel 5.8 (ErickTamayo#119)

* Elasticsearch downgrade

Co-authored-by: Erick Tamayo <ErickTamayo@users.noreply.github.com>
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Joey <joey.xf@gmail.com>
Co-authored-by: Tobias Kronthaler <kronthto@users.noreply.github.com>
Co-authored-by: Nirav <nirav.t.prajapati21@gmail.com>
Co-authored-by: Camilo <camilo.castro.cabrera@gmail.com>
Co-authored-by: Semyon Chetvertnyh <semyon.chetvertnyh@gmail.com>
  • Loading branch information
8 people authored and sonnysantino committed Jan 17, 2020
1 parent 6fbd981 commit 0a8de0d
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 106 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
language: php
php:
- 7.0
- 5.6

before_script:
- sleep 10
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev

script: vendor/phpunit/phpunit/phpunit --verbose
script: vendor/phpunit/phpunit/phpunit --verbose

services:
- elasticsearch

34 changes: 24 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@
"name": "tamayo/laravel-scout-elastic",
"description": "Elastic Driver for Laravel Scout",
"keywords": ["laravel", "scout", "elasticsearch", "elastic"],
"repositories": [
{
"type": "git",
"url": "git@github.com:maguilar92/scout.git"
}
],
"require": {
"php": ">=5.6.4",
"laravel/scout": "^1.0",
"illuminate/support": "^5.3",
"illuminate/database": "^5.3",
"elasticsearch/elasticsearch": "^2.2"
"php": "^7.2",
"laravel/scout": "dev-venice",
"elasticsearch/elasticsearch": "^2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"fzaninotto/faker": "^1.8",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^8.0"
},
"autoload": {
"psr-4": {
"ScoutEngines\\Elasticsearch\\": "src/"
Expand All @@ -24,6 +28,16 @@
"ScoutEngines\\Elasticsearch\\Test\\": "tests"
}
},
"minimum-stability": "stable",
"suggest": {
"elasticsearch/elasticsearch": "Required to use the Elasticsearch engine (^5.0)."
},
"extra": {
"laravel": {
"providers": [
"ScoutEngines\\Elasticsearch\\ElasticsearchProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit 0a8de0d

Please sign in to comment.