Skip to content

Commit e33134e

Browse files
committed
update: use only orderable meilisearch filters when necessary
Should improve indexing performance. Depends on upstream meilisearch change scheduled for v1.14: https://www.github.com/meilisearch/meilisearch/issues/5163
1 parent 51937c8 commit e33134e

File tree

2 files changed

+93
-71
lines changed

2 files changed

+93
-71
lines changed

app/DTO/TorrentSearchFiltersDTO.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ final public function toMeilisearchFilter(): array
607607
}
608608

609609
if ($this->alive) {
610-
$filters[] = 'seeders > 0';
610+
$filters[] = 'seeders != 0';
611611
}
612612

613613
if ($this->dying) {

config/scout.php

+92-70
Original file line numberDiff line numberDiff line change
@@ -146,76 +146,98 @@
146146
'resolution.name',
147147
],
148148
'filterableAttributes' => [
149-
'id',
150-
'name',
151-
'folder',
152-
'size',
153-
'leechers',
154-
'seeders',
155-
'times_completed',
156-
'created_at',
157-
'bumped_at',
158-
'fl_until',
159-
'du_until',
160-
'user_id',
161-
'imdb',
162-
'tvdb',
163-
'tmdb',
164-
'mal',
165-
'igdb',
166-
'season_number',
167-
'episode_number',
168-
'stream',
169-
'free',
170-
'doubleup',
171-
'refundable',
172-
'highspeed',
173-
'featured',
174-
'status',
175-
'anon',
176-
'sticky',
177-
'sd',
178-
'internal',
179-
'deleted_at',
180-
'personal_release',
181-
'trumpable',
182-
'info_hash',
183-
'history_seeders.user_id',
184-
'history_leechers.user_id',
185-
'history_active.user_id',
186-
'history_inactive.user_id',
187-
'history_complete.user_id',
188-
'history_incomplete.user_id',
189-
'user.username',
190-
'category.id',
191-
'category.movie_meta',
192-
'category.tv_meta',
193-
'type.id',
194-
'resolution.id',
195-
'movie.id',
196-
'movie.name',
197-
'movie.year',
198-
'movie.original_language',
199-
'movie.adult',
200-
'movie.genres.id',
201-
'movie.collection.id',
202-
'movie.companies.id',
203-
'movie.wishes.user_id',
204-
'tv.id',
205-
'tv.name',
206-
'tv.year',
207-
'tv.original_language',
208-
'tv.genres.id',
209-
'tv.networks.id',
210-
'tv.companies.id',
211-
'tv.wishes.user_id',
212-
'playlists.id',
213-
'bookmarks.user_id',
214-
'freeleech_tokens.user_id',
215-
'files.name',
216-
'keywords',
217-
'distributor_id',
218-
'region_id',
149+
[
150+
'attributePatterns' => [
151+
'id',
152+
'name',
153+
'folder',
154+
'leechers',
155+
'seeders',
156+
'bumped_at',
157+
'fl_until',
158+
'du_until',
159+
'user_id',
160+
'imdb',
161+
'tvdb',
162+
'tmdb',
163+
'mal',
164+
'igdb',
165+
'season_number',
166+
'episode_number',
167+
'stream',
168+
'free',
169+
'doubleup',
170+
'refundable',
171+
'highspeed',
172+
'featured',
173+
'status',
174+
'anon',
175+
'sticky',
176+
'sd',
177+
'internal',
178+
'deleted_at',
179+
'personal_release',
180+
'trumpable',
181+
'info_hash',
182+
'history_seeders.user_id',
183+
'history_leechers.user_id',
184+
'history_active.user_id',
185+
'history_inactive.user_id',
186+
'history_complete.user_id',
187+
'history_incomplete.user_id',
188+
'user.username',
189+
'category.id',
190+
'category.movie_meta',
191+
'category.tv_meta',
192+
'type.id',
193+
'resolution.id',
194+
'movie.id',
195+
'movie.name',
196+
'movie.original_language',
197+
'movie.adult',
198+
'movie.genres.id',
199+
'movie.collection.id',
200+
'movie.companies.id',
201+
'movie.wishes.user_id',
202+
'tv.id',
203+
'tv.name',
204+
'tv.original_language',
205+
'tv.genres.id',
206+
'tv.networks.id',
207+
'tv.companies.id',
208+
'tv.wishes.user_id',
209+
'playlists.id',
210+
'bookmarks.user_id',
211+
'freeleech_tokens.user_id',
212+
'files.name',
213+
'keywords',
214+
'distributor_id',
215+
'region_id',
216+
],
217+
"features" => [
218+
"facetSearch" => false,
219+
"filter" => [
220+
"equality" => true,
221+
"comparison" => false,
222+
],
223+
]
224+
],
225+
[
226+
'attributePatterns' => [
227+
'size',
228+
'times_completed',
229+
'created_at',
230+
'movie.year',
231+
'tv.year',
232+
],
233+
"features" => [
234+
"facetSearch" => false,
235+
"filter" => [
236+
"equality" => true,
237+
"comparison" => true,
238+
],
239+
]
240+
],
219241
],
220242
'sortableAttributes' => [
221243
'name',

0 commit comments

Comments
 (0)