@@ -6,10 +6,9 @@ use crate::models::ids::base62_impl::to_base62;
6
6
use crate :: search:: { SearchConfig , UploadSearchProject } ;
7
7
use local_import:: index_local;
8
8
use log:: info;
9
- use meilisearch_sdk:: client:: Client ;
9
+ use meilisearch_sdk:: client:: { Client , SwapIndexes } ;
10
10
use meilisearch_sdk:: indexes:: Index ;
11
11
use meilisearch_sdk:: settings:: { PaginationSetting , Settings } ;
12
- use meilisearch_sdk:: SwapIndexes ;
13
12
use sqlx:: postgres:: PgPool ;
14
13
use thiserror:: Error ;
15
14
#[ derive( Error , Debug ) ]
@@ -100,7 +99,7 @@ pub async fn swap_index(
100
99
config : & SearchConfig ,
101
100
index_name : & str ,
102
101
) -> Result < ( ) , IndexingError > {
103
- let client = config. make_client ( ) ;
102
+ let client = config. make_client ( ) ? ;
104
103
let index_name_next = config. get_index_name ( index_name, true ) ;
105
104
let index_name = config. get_index_name ( index_name, false ) ;
106
105
let swap_indices = SwapIndexes {
@@ -119,7 +118,7 @@ pub async fn get_indexes_for_indexing(
119
118
config : & SearchConfig ,
120
119
next : bool , // Get the 'next' one
121
120
) -> Result < Vec < Index > , meilisearch_sdk:: errors:: Error > {
122
- let client = config. make_client ( ) ;
121
+ let client = config. make_client ( ) ? ;
123
122
let project_name = config. get_index_name ( "projects" , next) ;
124
123
let project_filtered_name =
125
124
config. get_index_name ( "projects_filtered" , next) ;
@@ -285,7 +284,7 @@ pub async fn add_projects(
285
284
additional_fields : Vec < String > ,
286
285
config : & SearchConfig ,
287
286
) -> Result < ( ) , IndexingError > {
288
- let client = config. make_client ( ) ;
287
+ let client = config. make_client ( ) ? ;
289
288
for index in indices {
290
289
update_and_add_to_index ( & client, index, & projects, & additional_fields)
291
290
. await ?;
@@ -296,7 +295,7 @@ pub async fn add_projects(
296
295
297
296
fn default_settings ( ) -> Settings {
298
297
Settings :: new ( )
299
- . with_distinct_attribute ( "project_id" )
298
+ . with_distinct_attribute ( Some ( "project_id" ) )
300
299
. with_displayed_attributes ( DEFAULT_DISPLAYED_ATTRIBUTES )
301
300
. with_searchable_attributes ( DEFAULT_SEARCHABLE_ATTRIBUTES )
302
301
. with_sortable_attributes ( DEFAULT_SORTABLE_ATTRIBUTES )
0 commit comments