@@ -11,6 +11,7 @@ import play.api.libs.json._
1111 *
1212 */
1313trait SearchService {
14+ val queueName = " search"
1415
1516 def isEnabled (): Boolean
1617
@@ -24,10 +25,13 @@ trait SearchService {
2425 spaceid : Option [String ], folderid : Option [String ], field : Option [String ], tag : Option [String ],
2526 from : Option [Int ], size : Option [Int ], permitted : List [UUID ], user : Option [User ]): SearchResult
2627
27- def createIndex ()
28+ def createIndex (index : String )
29+
30+ // Swap default index with provided temporary reindex
31+ def swapIndex ()
2832
2933 /** Delete all indices */
30- def deleteAll ()
34+ def deleteAll (idx : String )
3135
3236 /** Delete an index */
3337 def delete (id : String , docType : String = " clowder_object" )
@@ -38,26 +42,26 @@ trait SearchService {
3842 /**
3943 * Reindex using a resource reference and route to correct handler
4044 */
41- def index (resource : ResourceRef , recursive : Boolean = true )
45+ def index (resource : ResourceRef , recursive : Boolean = true , idx : Option [ String ] )
4246
4347 /**
4448 * Reindex the given collection, if recursive is set to true it will
4549 * also reindex all datasets and files.
4650 */
47- def index (collection : Collection , recursive : Boolean )
51+ def index (collection : Collection , recursive : Boolean , idx : Option [ String ] )
4852
4953 /**
5054 * Reindex the given dataset, if recursive is set to true it will
5155 * also reindex all files.
5256 */
53- def index (dataset : Dataset , recursive : Boolean )
57+ def index (dataset : Dataset , recursive : Boolean , idx : Option [ String ] )
5458
5559 /** Reindex the given file. */
56- def index (file : File )
60+ def index (file : File , idx : Option [ String ] )
5761
58- def index (file : TempFile )
62+ def index (file : TempFile , idx : Option [ String ] )
5963
60- def index (section : Section )
64+ def index (section : Section , idx : Option [ String ] )
6165
6266 def indexAll (): String
6367
0 commit comments