This repository was archived by the owner on Jan 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1414 ],
1515 "require" : {
1616 "php" : " ^7.2|^8.0" ,
17- "laravel/scout" : " ~6.0|~7.0|~8.0"
17+ "laravel/scout" : " ~6.0|~7.0|~8.0|~9.0 "
1818 },
1919 "require-dev" : {
2020 "phpunit/phpunit" : " 8.5.x-dev" ,
Original file line number Diff line number Diff line change 22
33namespace Yab \MySQLScout \Engines ;
44
5+ use Illuminate \Support \LazyCollection ;
56use Yab \MySQLScout \Engines \Modes \ModeContainer ;
67use Illuminate \Database \Eloquent \Collection ;
78use Illuminate \Support \Facades \DB ;
@@ -165,4 +166,44 @@ protected function shouldUseFallback($builder)
165166 strlen ($ builder ->query ) < config ('scout.mysql.min_fulltext_search_length ' )) ||
166167 $ this ->fallbackSearchShouldBeUsedForModel ($ builder );
167168 }
169+
170+ /**
171+ * Map the given results to instances of the given model via a lazy collection.
172+ *
173+ * @param \Laravel\Scout\Builder $builder
174+ * @param mixed $results
175+ * @param \Illuminate\Database\Eloquent\Model $model
176+ * @return \Illuminate\Support\LazyCollection
177+ */
178+ public function lazyMap (Builder $ builder , $ results , $ model )
179+ {
180+ if ($ this ->getTotalCount ($ results ) === 0 ) {
181+ return LazyCollection::empty ();
182+ }
183+
184+ return LazyCollection::make ($ results ['results ' ]->all ());
185+ }
186+
187+ /**
188+ * Create a search index.
189+ *
190+ * @param string $name
191+ * @param array $options
192+ * @return mixed
193+ */
194+ public function createIndex ($ name , array $ options = [])
195+ {
196+
197+ }
198+
199+ /**
200+ * Delete a search index.
201+ *
202+ * @param string $name
203+ * @return mixed
204+ */
205+ public function deleteIndex ($ name )
206+ {
207+
208+ }
168209}
You can’t perform that action at this time.
0 commit comments