Skip to content

Commit

Permalink
Merge pull request #13 from visuellverstehen/main
Browse files Browse the repository at this point in the history
Update for MS v1.0, Statamic 4.0 and Laravel 10
  • Loading branch information
okaufmann authored May 29, 2023
2 parents d6bbe20 + 792d316 commit a633f67
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1, 8.0]
laravel: [9.*, 8.*]
statamic: [3.3.*, 3.2.*, 3.1.*]
php: [8.2, 8.1]
laravel: [10.*, 9.*]
statamic: [4.*, 3.4.*]
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
exclude:
- laravel: 9.*
statamic: 3.2.*
- laravel: 9.*
statamic: 3.1.*
- laravel: 8.*
statamic: 3.3.*
- laravel: 10.*
statamic: 3.4.*


name: P${{ matrix.php }} - L${{ matrix.laravel }} - S${{ matrix.statamic }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Statamic MeiliSearch Driver

***Disclaimer: This search driver is used on a large production site, however MeiliSearch is still changing often, so some problems may occur. Please submit any bugs you find so we can make the driver more stable. If you would like to help maintain the driver, please reach out.***

MeiliSearch driver uses a versioning system that matches MeiliSearch releases to try match releases with any breaking changes. For instance to work with v0.24 you would install the corresponding driver:

```json
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
}
],
"require": {
"php": "^8.0",
"meilisearch/meilisearch-php": "^0.21|^0.22|^0.23|^0.24|^0.25",
"php": "^8.1|^8.2",
"meilisearch/meilisearch-php": "^1.0",
"guzzlehttp/guzzle": "^7.3",
"http-interop/http-factory-guzzle": "^1.0",
"illuminate/support": "^8.0|^9.0",
"statamic/cms": "^3.1|^3.2|^3.3"
"illuminate/support": "^9.0|^10.0",
"statamic/cms": "^3.4|^4.0"
},
"require-dev": {
"orchestra/testbench-core": "^6.0|^7.0",
"orchestra/testbench-core": "^6.0|^7.0|^8.0",
"phpunit/phpunit": "^9.3"
},
"autoload": {
Expand All @@ -50,7 +50,8 @@
},
"config": {
"allow-plugins": {
"pixelfear/composer-dist-plugin": true
"pixelfear/composer-dist-plugin": true,
"php-http/discovery": true
}
},
"extra": {
Expand Down
7 changes: 6 additions & 1 deletion src/MeiliSearch/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ protected function createIndex()
{
try {
$this->client->createIndex($this->name, ['primaryKey' => 'id']);
$this->getIndex()->updateSettings($this->config['settings'] ?? []);

if (! isset($this->config['settings'])) {
return;
}

$this->getIndex()->updateSettings($this->config['settings']);
} catch (ApiException $e) {
$this->handleMeiliSearchException($e, 'createIndex');
}
Expand Down

0 comments on commit a633f67

Please sign in to comment.