meilisearch 0.15.4 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03f23776fd7b1baeabbfcc33fcd848f8bd89f56655579756d9e2c06492f8d824
4
- data.tar.gz: d5137b74a7def336e41e746d56f714847be1f73185c5f05abf70a03310cc79b4
3
+ metadata.gz: c67baca928880c0efd95580e84a4b3f11f8fbab279a8eec5e6a7ffd64467ce85
4
+ data.tar.gz: ee39b314f6607c5ccd219d16bb6e0cb88d971b7113fa1c9091b11634b34e5062
5
5
  SHA512:
6
- metadata.gz: c2c1fee375d80f6e0c372438b3fbb4c76b4c504f0c7ddf1d12d810e89f93f8173e838b1d6d8cf1d57ba02f75277f784660379c8961ccb47884eb2e37d7a43f06
7
- data.tar.gz: ab566b980a0ab15a5ffef99fb47520f667783c098e3ea81fa35784a12d1806846b18a80f42116f0605e2770655a62f35b97e8881983b08ff865de28fcde89c7a
6
+ metadata.gz: aa7d0a46d608c88ac58786f70d95001c845123c5df29fe3644ddfe8669f87744102076a6610b993b05dd733512922def3ece255fcd562dac103696f07c779a66
7
+ data.tar.gz: e6b254f4fc93e8e9f4a0f6aa8df701fbd30cc6565021c0c61f81e709fc96b3423ca0eb4cc6097eb2abba91c76ea6298128e4765c9f2f1f3ce58ba807a8d93bb7
@@ -129,11 +129,15 @@ module MeiliSearch
129
129
  http_get "/indexes/#{@uid}/updates"
130
130
  end
131
131
 
132
+ def achieved_upate?(update)
133
+ update['status'] != 'enqueued' && update['status'] != 'processing'
134
+ end
135
+
132
136
  def wait_for_pending_update(update_id, timeout_in_ms = 5000, interval_in_ms = 50)
133
137
  Timeout.timeout(timeout_in_ms.to_f / 1000) do
134
138
  loop do
135
139
  get_update = get_update_status(update_id)
136
- return get_update if get_update['status'] != 'enqueued'
140
+ return get_update if achieved_upate?(get_update)
137
141
 
138
142
  sleep interval_in_ms.to_f / 1000
139
143
  end
@@ -160,8 +164,8 @@ module MeiliSearch
160
164
  stats['lastUpdate']
161
165
  end
162
166
 
163
- def fields_distribution
164
- stats['fieldsDistribution']
167
+ def field_distribution
168
+ stats['fieldDistribution']
165
169
  end
166
170
 
167
171
  ### SETTINGS - GENERAL
@@ -220,7 +224,7 @@ module MeiliSearch
220
224
  alias get_stop_words stop_words
221
225
 
222
226
  def update_stop_words(stop_words)
223
- body = stop_words.is_a?(Array) ? stop_words : [stop_words]
227
+ body = stop_words.nil? || stop_words.is_a?(Array) ? stop_words : [stop_words]
224
228
  http_post "/indexes/#{@uid}/settings/stop-words", body
225
229
  end
226
230
  alias stop_words= update_stop_words
@@ -277,20 +281,20 @@ module MeiliSearch
277
281
  http_delete "/indexes/#{@uid}/settings/displayed-attributes"
278
282
  end
279
283
 
280
- ### SETTINGS - ATTRIBUTES FOR FACETING
284
+ ### SETTINGS - FILTERABLE ATTRIBUTES
281
285
 
282
- def attributes_for_faceting
283
- http_get "/indexes/#{@uid}/settings/attributes-for-faceting"
286
+ def filterable_attributes
287
+ http_get "/indexes/#{@uid}/settings/filterable-attributes"
284
288
  end
285
- alias get_attributes_for_faceting attributes_for_faceting
289
+ alias get_filterable_attributes filterable_attributes
286
290
 
287
- def update_attributes_for_faceting(attributes_for_faceting)
288
- http_post "/indexes/#{@uid}/settings/attributes-for-faceting", attributes_for_faceting
291
+ def update_filterable_attributes(filterable_attributes)
292
+ http_post "/indexes/#{@uid}/settings/filterable-attributes", filterable_attributes
289
293
  end
290
- alias attributes_for_faceting= update_attributes_for_faceting
294
+ alias filterable_attributes= update_filterable_attributes
291
295
 
292
- def reset_attributes_for_faceting
293
- http_delete "/indexes/#{@uid}/settings/attributes-for-faceting"
296
+ def reset_filterable_attributes
297
+ http_delete "/indexes/#{@uid}/settings/filterable-attributes"
294
298
  end
295
299
  end
296
300
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeiliSearch
4
- VERSION = '0.15.4'
4
+ VERSION = '0.16.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meilisearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.4
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-11 00:00:00.000000000 Z
11
+ date: 2021-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty