mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add title_synonyms + fix: accidentally removed popularity sort
This commit is contained in:
parent
29115b54d2
commit
8905061d9e
@ -178,14 +178,15 @@ class Anime extends JikanApiSearchableModel
|
|||||||
return [
|
return [
|
||||||
'title',
|
'title',
|
||||||
'title_english',
|
'title_english',
|
||||||
'title_japanese'
|
'title_japanese',
|
||||||
|
'title_synonyms'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeSenseQueryByWeights(): string|null
|
public function getTypeSenseQueryByWeights(): string|null
|
||||||
{
|
{
|
||||||
// this way title_synonyms will rank lower in search results
|
// this way title_synonyms will rank lower in search results
|
||||||
return "2,1,2";
|
return "3,2,3,1";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -195,6 +196,10 @@ class Anime extends JikanApiSearchableModel
|
|||||||
public function getSearchIndexSortBy(): array|null
|
public function getSearchIndexSortBy(): array|null
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
[
|
||||||
|
"field" => "popularity",
|
||||||
|
"direction" => "asc"
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"field" => "_text_match",
|
"field" => "_text_match",
|
||||||
"direction" => "desc"
|
"direction" => "desc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user