]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/search.ts
Add search index tests
[github/Chocobozzz/PeerTube.git] / server / controllers / api / search.ts
index e08e1d79fa15baea1ec64193c49e30e9e6d31cdc..1dea77d2925fed81f351316295090571afa6d606 100644 (file)
@@ -76,7 +76,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) {
   // @username -> username to search in DB
   if (query.search.startsWith('@')) query.search = query.search.replace(/^@/, '')
 
-  if (isSearchIndexEnabled(query)) {
+  if (isSearchIndexSearch(query)) {
     return searchVideoChannelsIndex(query, res)
   }
 
@@ -157,7 +157,7 @@ function searchVideos (req: express.Request, res: express.Response) {
     return searchVideoURI(search, res)
   }
 
-  if (isSearchIndexEnabled(query)) {
+  if (isSearchIndexSearch(query)) {
     return searchVideosIndex(query, res)
   }
 
@@ -226,7 +226,7 @@ async function searchVideoURI (url: string, res: express.Response) {
   })
 }
 
-function isSearchIndexEnabled (query: SearchTargetQuery) {
+function isSearchIndexSearch (query: SearchTargetQuery) {
   if (query.searchTarget === 'search-index') return true
 
   const searchIndexConfig = CONFIG.SEARCH.SEARCH_INDEX