@@ -282,7 +282,7 @@ def self.log_or_throw(method, raise_on_failure, &block)
282
282
case method . to_s
283
283
when 'search'
284
284
# some attributes are required
285
- { 'hits' => [ ] , 'hitsPerPage' => 0 , 'page' => 0 , 'facetsDistribution ' => { } , 'error' => e }
285
+ { 'hits' => [ ] , 'hitsPerPage' => 0 , 'page' => 0 , 'facetDistribution ' => { } , 'error' => e }
286
286
else
287
287
# empty answer
288
288
{ 'error' => e }
@@ -460,7 +460,7 @@ def ms_reindex!(batch_size = MeiliSearch::Rails::IndexSettings::DEFAULT_BATCH_SI
460
460
end
461
461
last_task = index . add_documents ( documents )
462
462
end
463
- index . wait_for_task ( last_task [ 'uid ' ] ) if last_task && ( synchronous || options [ :synchronous ] )
463
+ index . wait_for_task ( last_task [ 'taskUid ' ] ) if last_task && ( synchronous || options [ :synchronous ] )
464
464
end
465
465
nil
466
466
end
@@ -476,7 +476,7 @@ def ms_set_settings(synchronous = false)
476
476
477
477
index = SafeIndex . new ( ms_index_uid ( options ) , true , options )
478
478
task = index . update_settings ( final_settings )
479
- index . wait_for_task ( task [ 'uid ' ] ) if synchronous
479
+ index . wait_for_task ( task [ 'taskUid ' ] ) if synchronous
480
480
end
481
481
end
482
482
@@ -486,7 +486,7 @@ def ms_index_documents(documents, synchronous = false)
486
486
487
487
index = ms_ensure_init ( options , settings )
488
488
task = index . add_documents ( documents . map { |d | settings . get_attributes ( d ) . merge ms_pk ( options ) => ms_primary_key_of ( d , options ) } )
489
- index . wait_for_task ( task [ 'uid ' ] ) if synchronous || options [ :synchronous ]
489
+ index . wait_for_task ( task [ 'taskUid ' ] ) if synchronous || options [ :synchronous ]
490
490
end
491
491
end
492
492
@@ -583,7 +583,7 @@ def ms_raw_answer
583
583
end
584
584
585
585
def ms_facets_distribution
586
- @ms_json [ 'facetsDistribution ' ]
586
+ @ms_json [ 'facetDistribution ' ]
587
587
end
588
588
589
589
private
@@ -605,8 +605,8 @@ def ms_search(query, params = {})
605
605
end
606
606
607
607
# Returns raw json hits as follows:
608
- # {"hits"=>[{"id"=>"13", "href"=>"apple", "name"=>"iphone"}], "offset"=>0, "limit"=>|| 20, "nbHits "=>1,
609
- # "exhaustiveNbHits"=>false, " processingTimeMs"=>0, "query"=>"iphone"}
608
+ # {"hits"=>[{"id"=>"13", "href"=>"apple", "name"=>"iphone"}], "offset"=>0, "limit"=>|| 20, "estimatedTotalHits "=>1,
609
+ # "processingTimeMs"=>0, "query"=>"iphone"}
610
610
json = ms_raw_search ( query , params )
611
611
612
612
# Returns the ids of the hits: 13
0 commit comments