meilisearch-rails 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0d3aeaf9f6e2549c11cdcd7cf5920fecb819fb1b2f03a25af11c19a5dd09444
4
- data.tar.gz: 0af07156e3e3ea69d492745f806751e2213ad7148553f57396528ad54fa3f02a
3
+ metadata.gz: 7b992f0ae920706899ea36534585a605e0ce7dcee087bcb5aa5a1fa7f29fbede
4
+ data.tar.gz: 7d4339178919b50b791f129485dc20646fb7122910073f99a469ef15e3da7452
5
5
  SHA512:
6
- metadata.gz: a49c6d3b48de31033515e61c9fd182842d5d7d7ba90e140b6447339eeb6473139f3de4f1c3428f48a9176f3c36c5080ebc198897f4b53900f74e416bb817eaf1
7
- data.tar.gz: 63805d38ba88e0b020a0a147cce244ec35a0fb2a93715ff5b62df77ca87021b2b11581647626b2c76eaddc26ad15ab0a8e9d4e82c7e1895095829b7cce74965c
6
+ metadata.gz: 202e76dd8aa69ee7440698ac6af2cff4d2b80016f50f39da95c24f40a824f2095a8481b1f6db64d95d07428d406739fa04513c8efa0ee29d0bbe95a6d77f7183
7
+ data.tar.gz: eba66cf0d9a4a5059c40325e8b848478a0268d3650d8f0aacc41598d68c555f6f793d56c19456f79ed08b08fd748a7a1474b2621cd9b211a7dd1c27502fb685c
data/README.md CHANGED
@@ -58,7 +58,7 @@ To learn more about Meilisearch, check out our [Documentation](https://docs.meil
58
58
 
59
59
  ## 🤖 Compatibility with Meilisearch
60
60
 
61
- This package only guarantees the compatibility with the [version v0.27.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.27.0).
61
+ This package only guarantees the compatibility with the [version v0.28.0 of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/v0.28.0).
62
62
 
63
63
  ## 🔧 Installation <!-- omit in toc -->
64
64
 
@@ -262,19 +262,7 @@ end
262
262
 
263
263
  #### Index UID according to the environment <!-- omit in toc -->
264
264
 
265
- You can suffix the index UID with the current Rails environment using one of the following options:
266
-
267
- By defining directly in your model:
268
-
269
- ```ruby
270
- class Book < ActiveRecord::Base
271
- include MeiliSearch::Rails
272
-
273
- meilisearch per_environment: true
274
- end
275
- ```
276
-
277
- Or setting it globally:
265
+ You can suffix the index UID with the current Rails environment by setting it globally:
278
266
 
279
267
  ```ruby
280
268
  MeiliSearch::Rails.configuration = {
@@ -284,7 +272,7 @@ MeiliSearch::Rails.configuration = {
284
272
  }
285
273
  ```
286
274
 
287
- Both options will make your index name look like this `"Book_#{Rails.env}"`.
275
+ This way your index UID will look like this `"Book_#{Rails.env}"`.
288
276
 
289
277
  ### Index configuration
290
278
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module MeiliSearch
4
4
  module Rails
5
- VERSION = '0.6.0'
5
+ VERSION = '0.7.0'
6
6
  end
7
7
  end
@@ -282,7 +282,7 @@ module MeiliSearch
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 @@ module MeiliSearch
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 @@ module MeiliSearch
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 @@ module MeiliSearch
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 @@ module MeiliSearch
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 @@ module MeiliSearch
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
@@ -34,5 +34,5 @@ Gem::Specification.new do |s|
34
34
 
35
35
  s.required_ruby_version = '>= 2.6.0'
36
36
 
37
- s.add_dependency 'meilisearch', '~> 0.18'
37
+ s.add_dependency 'meilisearch', '~> 0.19'
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meilisearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: meilisearch
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.18'
19
+ version: '0.19'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.18'
26
+ version: '0.19'
27
27
  description: Meilisearch integration for Ruby on Rails. See https://github.com/meilisearch/meilisearch
28
28
  email: bonjour@meilisearch.com
29
29
  executables: []