New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search implementation overhaul #2857
Search implementation overhaul #2857
Conversation
not sure if improvement...
Comes with dodgy remappings :D
…or...or something ?_?
e1fd1af
to
28c9a2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ಠ_ಠ
app/Libraries/Search/UserSearch.php
Outdated
*/ | ||
public function overLimit() | ||
{ | ||
return $this->response()->total() > config('osu.search.max.user'); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
public function __construct(string $index, $type, SearchParams $params) | ||
{ | ||
parent::__construct($index, $params); | ||
$this->recordType = $type; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
app/Libraries/Search/UserSearch.php
Outdated
|
||
class UserSearch extends RecordSearch | ||
{ | ||
public function __construct(UserSearchParams $params) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
'all' => null, | ||
'user' => [ | ||
'type' => UserSearch::class, | ||
'paramsType' => UserSearchRequestParams::class, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
$this->params = $params; | ||
|
||
if ($this->params->page !== null) { | ||
$this->page($this->params->page); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
app/Libraries/Search/UserSearch.php
Outdated
*/ | ||
public function total() | ||
{ | ||
return min($this->response()->total(), config('osu.search.max.user')); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
return html_excerpt($post->source('search_content')); | ||
}, iterator_to_array($firstPost))); | ||
|
||
$user = $users->where('user_id', $entry->source('poster_id'))->first() ?? new App\Models\DeletedUser(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
<div class="page-mode__item"> | ||
<a | ||
href="{{ route('search', ['mode' => $mode, 'query' => request('query')]) }}" | ||
class="page-mode-link {{ isset($active) && $active ? 'page-mode-link--is-active' : '' }}" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getCacheKey() : string |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
4f899c3
to
bbfdd7e
Compare
reorganized with a brick.
fixes #2707
fixes #2590
adds counts to each tab in
/home/search
reduce forum search page size to 20
switched the beatmap listing caching from caching the search response to caching the transformed json output.
added the 100 user search result limit back in.
user quick search only returns recently active users.
Moved parts of the search queries that probably should not affect scoring to run in a
filter
query instead.Separate search classes for different searches; parameters should be parsed before going into search.
Makes the parameters used for building the queries less dependent on the request parameters.
Explicit parameter handlers for search classes.
make more use of the query builder and typings when handling searches.
SearchParams
comes with an interface for determining cacheability of queries.Search::response()
is automatically memoized.querying elasticsearch for no term matching is now always considered different from
''
Was originally going to implement
->paginate()
but that turned out to be a terrible interface to actually use for more complicated scenarios.