mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 03:59:08 -05:00
add: prefix option
This commit is contained in:
@@ -47,7 +47,7 @@ class AutoSyncPeopleToMeilisearch extends Command
|
||||
$start = now();
|
||||
|
||||
$client = new Client(config('scout.meilisearch.host'), config('scout.meilisearch.key'));
|
||||
$index = $client->index('people');
|
||||
$index = $client->index(config('scout.prefix').'people');
|
||||
|
||||
$people = Person::all(['id', 'name', 'birthday', 'still']);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class AutoSyncTorrentsToMeilisearch extends Command
|
||||
|
||||
$client = new Client(config('scout.meilisearch.host'), config('scout.meilisearch.key'));
|
||||
|
||||
$index = $client->getIndex('torrents');
|
||||
$index = $client->getIndex(config('scout.prefix').'torrents');
|
||||
|
||||
$index->updatePagination([
|
||||
'maxTotalHits' => max(1, Torrent::query()->count()) + 1000,
|
||||
|
||||
@@ -59,7 +59,7 @@ class QuickSearchController extends Controller
|
||||
// Prepare the search queries
|
||||
$searchQueries = [
|
||||
(new SearchQuery())
|
||||
->setIndexUid('torrents')
|
||||
->setIndexUid(config('scout.prefix').'torrents')
|
||||
->setQuery($searchById ? '' : $query)
|
||||
->setFilter($filters)
|
||||
->setDistinct('imdb')
|
||||
@@ -68,7 +68,7 @@ class QuickSearchController extends Controller
|
||||
// Add the people search query only if it's not an ID search
|
||||
if (!$searchById) {
|
||||
$searchQueries[] = (new SearchQuery())
|
||||
->setIndexUid('people')
|
||||
->setIndexUid(config('scout.prefix').'people')
|
||||
->setQuery($query);
|
||||
//->setFederationOptions((new FederationOptions())->setWeight(0.9));
|
||||
}
|
||||
@@ -80,7 +80,7 @@ class QuickSearchController extends Controller
|
||||
|
||||
// Process the hits from the multiSearchResults
|
||||
foreach ($multiSearchResults['hits'] as $hit) {
|
||||
if ($hit['_federation']['indexUid'] === 'torrents') {
|
||||
if ($hit['_federation']['indexUid'] === config('scout.prefix').'torrents') {
|
||||
$type = $hit['category']['movie_meta'] === true ? 'movie' : 'tv';
|
||||
|
||||
$results[] = [
|
||||
@@ -91,7 +91,7 @@ class QuickSearchController extends Controller
|
||||
'url' => route('torrents.similar', ['category_id' => $hit['category']['id'], 'tmdb' => $hit['tmdb']]),
|
||||
'type' => $type === 'movie' ? 'Movie' : 'TV Series',
|
||||
];
|
||||
} elseif ($hit['_federation']['indexUid'] === 'people') {
|
||||
} elseif ($hit['_federation']['indexUid'] === config('scout.prefix').'people') {
|
||||
$results[] = [
|
||||
'id' => $hit['id'],
|
||||
'name' => $hit['name'],
|
||||
|
||||
@@ -487,7 +487,7 @@ class TorrentSearch extends Component
|
||||
$torrents = $torrents->paginate(min($this->perPage, 100));
|
||||
} else {
|
||||
$client = new Client(config('scout.meilisearch.host'), config('scout.meilisearch.key'));
|
||||
$index = $client->getIndex('torrents');
|
||||
$index = $client->getIndex(config('scout.prefix').'torrents');
|
||||
|
||||
$results = $index->search($this->name, [
|
||||
'sort' => [
|
||||
|
||||
Reference in New Issue
Block a user