Comments (4)
If you don't care about new Scout 9 features and just want to upgrade, this patch implements stubs for the new Scout 9 methods:
From 91743119444f97a6f289e17827cfc8309f51d1cd Mon Sep 17 00:00:00 2001
From: AlbinoDrought <snip>
Date: Fri, 5 Aug 2022 07:38:13 -0700
Subject: [PATCH] feat: Laravel 9 support
---
composer.json | 10 +++++-----
src/PostgresEngine.php | 21 +++++++++++++++++++--
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/composer.json b/composer.json
index 305a86c..5007ed1 100644
--- a/composer.json
+++ b/composer.json
@@ -23,11 +23,11 @@
}
],
"require": {
- "php": "^7.2|^8.0",
- "illuminate/contracts": "~6.0|~7.0|~8.0",
- "illuminate/database": "~6.0|~7.0|~8.0",
- "illuminate/support": "~6.0|~7.0|~8.0",
- "laravel/scout": "~7.0|~8.0"
+ "php": "^8.0",
+ "illuminate/contracts": "^9.0",
+ "illuminate/database": "^9.0",
+ "illuminate/support": "^9.0",
+ "laravel/scout": "^9.0"
},
"require-dev": {
"phpunit/phpunit": "^8.3",
diff --git a/src/PostgresEngine.php b/src/PostgresEngine.php
index b92b3e0..8504090 100644
--- a/src/PostgresEngine.php
+++ b/src/PostgresEngine.php
@@ -6,6 +6,7 @@ use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
+use Illuminate\Support\LazyCollection;
use Laravel\Scout\Builder;
use Laravel\Scout\Engines\Engine;
use ScoutEngines\Postgres\TsQuery\PhraseToTsQuery;
@@ -75,7 +76,6 @@ class PostgresEngine extends Engine
* Perform update of the given model.
*
* @param \Illuminate\Database\Eloquent\Model $model
- * @return bool
*/
protected function performUpdate(Model $model)
{
@@ -339,6 +339,24 @@ class PostgresEngine extends Engine
});
}
+ public function lazyMap(Builder $builder, $results, $model)
+ {
+ // not supported
+ return new LazyCollection(
+ $this->map($builder, $results, $model)
+ );
+ }
+
+ public function createIndex($name, array $options = [])
+ {
+ return null;
+ }
+
+ public function deleteIndex($name)
+ {
+ return null;
+ }
+
/**
* Connect to the database.
*/
@@ -389,7 +407,6 @@ class PostgresEngine extends Engine
* Get rank function.
*
* @param \Illuminate\Database\Eloquent\Model $model
- * @return int
*/
protected function rankFunction(Model $model)
{
--
2.37.1
(the changed PHPDoc is due to Psalm complaints, rankFunction
actually returns string, performUpdate
actually returns int|bool)
from laravel-scout-postgres.
Would like to 2nd this question/issue. Laravel 8 is going to stop getting bug fixes next week (July 26, 2022). This package is useful to me and would like to continue using it in the newer versions of Laravel.
from laravel-scout-postgres.
Following the above patch to Scout 9, the BC-break changes in Laravel 10 and Scout 10 do not impact this package:
From da73332097fbff3a694f3fb7d0a08e01a78066be Mon Sep 17 00:00:00 2001
From: AlbinoDrought <snip>
Date: Thu, 16 Mar 2023 11:15:06 -0700
Subject: [PATCH] feat: Laravel 10, Scout 10 support
---
composer.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/composer.json b/composer.json
index 5007ed1..6146c4f 100644
--- a/composer.json
+++ b/composer.json
@@ -24,10 +24,10 @@
],
"require": {
"php": "^8.0",
- "illuminate/contracts": "^9.0",
- "illuminate/database": "^9.0",
- "illuminate/support": "^9.0",
- "laravel/scout": "^9.0"
+ "illuminate/contracts": "^10.0 || ^9.0",
+ "illuminate/database": "^10.0 || ^9.0",
+ "illuminate/support": "^10.0 || ^9.0",
+ "laravel/scout": "^10.0 || ^9.0"
},
"require-dev": {
"phpunit/phpunit": "^8.3",
--
2.38.1
from laravel-scout-postgres.
@AlbinoDrought I've not seen any responses or updates, I've forked this project and am trying to update/maintain the driver.
from laravel-scout-postgres.
Related Issues (20)
- Update? HOT 1
- How to sort or order by the search results with specific columns? HOT 1
- Searching model with Soft Delete
- Class 'ScoutEngines\Postgres\PostgresEngineServiceProvider' not found HOT 2
- No support for Laravel Scout 5.0 HOT 1
- Use postgres solely for scout indexes
- No support for Laravel Scout 6.x HOT 2
- Unique Violation
- Use with multiple databases/schemas ?
- Laravel 6 support HOT 6
- Can't use in when
- Some support for ignoring accentuation? HOT 2
- Index new records only HOT 1
- Scout 7 on Laravel 7.x HOT 1
- Getting all columns even hidden HOT 1
- Breaking HTTP Tests HOT 4
- specify vector language on each row
- Score for rows HOT 1
- `shouldBeSearchable` not implemented
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-scout-postgres.