diff options
Diffstat (limited to 'server/controllers/api/search.ts')
-rw-r--r-- | server/controllers/api/search.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index e08e1d79f..1dea77d29 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts | |||
@@ -76,7 +76,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) { | |||
76 | // @username -> username to search in DB | 76 | // @username -> username to search in DB |
77 | if (query.search.startsWith('@')) query.search = query.search.replace(/^@/, '') | 77 | if (query.search.startsWith('@')) query.search = query.search.replace(/^@/, '') |
78 | 78 | ||
79 | if (isSearchIndexEnabled(query)) { | 79 | if (isSearchIndexSearch(query)) { |
80 | return searchVideoChannelsIndex(query, res) | 80 | return searchVideoChannelsIndex(query, res) |
81 | } | 81 | } |
82 | 82 | ||
@@ -157,7 +157,7 @@ function searchVideos (req: express.Request, res: express.Response) { | |||
157 | return searchVideoURI(search, res) | 157 | return searchVideoURI(search, res) |
158 | } | 158 | } |
159 | 159 | ||
160 | if (isSearchIndexEnabled(query)) { | 160 | if (isSearchIndexSearch(query)) { |
161 | return searchVideosIndex(query, res) | 161 | return searchVideosIndex(query, res) |
162 | } | 162 | } |
163 | 163 | ||
@@ -226,7 +226,7 @@ async function searchVideoURI (url: string, res: express.Response) { | |||
226 | }) | 226 | }) |
227 | } | 227 | } |
228 | 228 | ||
229 | function isSearchIndexEnabled (query: SearchTargetQuery) { | 229 | function isSearchIndexSearch (query: SearchTargetQuery) { |
230 | if (query.searchTarget === 'search-index') return true | 230 | if (query.searchTarget === 'search-index') return true |
231 | 231 | ||
232 | const searchIndexConfig = CONFIG.SEARCH.SEARCH_INDEX | 232 | const searchIndexConfig = CONFIG.SEARCH.SEARCH_INDEX |