Skip to content

Commit

Permalink
refactor: if there is no index, no exception is thrown anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
malteriechmann committed Feb 27, 2024
1 parent 2552ba5 commit 6a0c622
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Classes/Service/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ public function search(string $query, string $sorting = 'crdate_desc', array $ty
return $result;
}

// Do not try to search when caching is disabled
// We might have no index ready and an exception
// would occur
if ($GLOBALS['TSFE']->no_cache === true) {
return $result;
}

[$sortingColumn, $sortingDesc] = explode('_', $sorting);

foreach ($types as $type) {
Expand Down

2 comments on commit 6a0c622

@runepiper
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message does not match code change, does it?

@malteriechmann
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a misunderstanding. What I mean:

With the version 1.6 of MeiliSearch / meilisearch/meilisearch-php an exception will not be thrown anymore, even if there is no index. The code comment said „We might have no index ready and an exception would occur“. In my tests under version 1.6 I just got back an empty result list – no exception or error.

Please sign in to comment.