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 +4 -4
- data/README.md +3 -15
- data/lib/meilisearch/rails/version.rb +1 -1
- data/lib/meilisearch-rails.rb +7 -7
- data/meilisearch-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b992f0ae920706899ea36534585a605e0ce7dcee087bcb5aa5a1fa7f29fbede
|
4
|
+
data.tar.gz: 7d4339178919b50b791f129485dc20646fb7122910073f99a469ef15e3da7452
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
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
|
-
|
275
|
+
This way your index UID will look like this `"Book_#{Rails.env}"`.
|
288
276
|
|
289
277
|
### Index configuration
|
290
278
|
|
data/lib/meilisearch-rails.rb
CHANGED
@@ -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, '
|
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['
|
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['
|
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['
|
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['
|
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, "
|
609
|
-
# "
|
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
|
data/meilisearch-rails.gemspec
CHANGED
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.
|
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-
|
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.
|
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.
|
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: []
|