This repository was archived by the owner on Jan 9, 2024. It is now read-only.
File tree 2 files changed +42
-1
lines changed
2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 14
14
],
15
15
"require" : {
16
16
"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 "
18
18
},
19
19
"require-dev" : {
20
20
"phpunit/phpunit" : " 8.5.x-dev" ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace Yab \MySQLScout \Engines ;
4
4
5
+ use Illuminate \Support \LazyCollection ;
5
6
use Yab \MySQLScout \Engines \Modes \ModeContainer ;
6
7
use Illuminate \Database \Eloquent \Collection ;
7
8
use Illuminate \Support \Facades \DB ;
@@ -165,4 +166,44 @@ protected function shouldUseFallback($builder)
165
166
strlen ($ builder ->query ) < config ('scout.mysql.min_fulltext_search_length ' )) ||
166
167
$ this ->fallbackSearchShouldBeUsedForModel ($ builder );
167
168
}
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
+ }
168
209
}
You can’t perform that action at this time.
0 commit comments