meilisearch 0.25.1 → 0.26.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: 64423a34ad9823417a67cf271103db76b41c3895470dbd13a1c90d986792d439
4
- data.tar.gz: 1bc5ba4774f7704cc6aefed0458dab6de7f4a4c0b4e45c9bb762b4843fc7c5ed
3
+ metadata.gz: e182244659129f40ceff661d8e117af391a68aa1cf5fed79f198fc715863ba4e
4
+ data.tar.gz: 17f9fd0b3b529829f1bd3d4d39cb3444532ec2cc14b0aebaeac00bae6f217d9b
5
5
  SHA512:
6
- metadata.gz: 37800a57fffe10aa250adf14af4b34855af7281c4adc7b4c0b62b573ad87ff365095493be04b56c2451de79aac20533625738bee98f70c5c124302bfe6172096
7
- data.tar.gz: b15bb586f86ba17e6b7546b246380458c1573c3c2c038e00610e2e83b1ad08dbf06293cdb1180cf309ee4317f0441f0df5edc08273d3f1ffe3b363e8acc09fe1
6
+ metadata.gz: 6aefe0097ef3f3c1785f1498ade5508ac77fca3e5aef025931d7ec34e12462419721cd2b7a1ee9d8c5037a36fa0dedd3aeabb35b473a400e05b9880401495149
7
+ data.tar.gz: 5b9949303254ca87e378904dadbbf0f7fc77a113cbda175dfb7bb950b674ed09742d411c0fb45cbc3a5626c6c16ebd1549e402b76504016b1e9567e28ba4e084
data/README.md CHANGED
@@ -30,7 +30,7 @@
30
30
 
31
31
  **Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)
32
32
 
33
- ## Table of Contents <!-- omit in toc -->
33
+ ## Table of Contents <!-- omit in TOC -->
34
34
 
35
35
  - [📖 Documentation](#-documentation)
36
36
  - [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)
@@ -1,7 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeiliSearch
4
- class ApiError < StandardError
4
+ class Error < StandardError
5
+ end
6
+
7
+ class ApiError < Error
5
8
  # :http_code # e.g. 400, 404...
6
9
  # :http_message # e.g. Bad Request, Not Found...
7
10
  # :http_body # The response body received from the MeiliSearch API
@@ -45,7 +48,7 @@ module MeiliSearch
45
48
  end
46
49
  end
47
50
 
48
- class CommunicationError < StandardError
51
+ class CommunicationError < Error
49
52
  attr_reader :message
50
53
 
51
54
  def initialize(message)
@@ -54,7 +57,7 @@ module MeiliSearch
54
57
  end
55
58
  end
56
59
 
57
- class TimeoutError < StandardError
60
+ class TimeoutError < Error
58
61
  attr_reader :message
59
62
 
60
63
  def initialize(message = nil)
@@ -64,8 +67,8 @@ module MeiliSearch
64
67
  end
65
68
 
66
69
  module TenantToken
67
- class ExpireOrInvalidSignature < StandardError; end
68
- class InvalidApiKey < StandardError; end
69
- class InvalidSearchRules < StandardError; end
70
+ class ExpireOrInvalidSignature < MeiliSearch::Error; end
71
+ class InvalidApiKey < MeiliSearch::Error; end
72
+ class InvalidSearchRules < MeiliSearch::Error; end
70
73
  end
71
74
  end
@@ -234,6 +234,15 @@ module MeiliSearch
234
234
  response
235
235
  end
236
236
 
237
+ ### FACET SEARCH
238
+
239
+ def facet_search(name, query = '', **options)
240
+ options.merge!(facet_name: name, facet_query: query)
241
+ options = Utils.transform_attributes(options)
242
+
243
+ http_post("/indexes/#{@uid}/facet-search", options)
244
+ end
245
+
237
246
  ### TASKS
238
247
 
239
248
  def task_endpoint
@@ -461,5 +470,49 @@ module MeiliSearch
461
470
  def reset_faceting
462
471
  http_delete("/indexes/#{@uid}/settings/faceting")
463
472
  end
473
+
474
+ ### SETTINGS - DICTIONARY
475
+
476
+ def dictionary
477
+ http_get("/indexes/#{@uid}/settings/dictionary")
478
+ end
479
+
480
+ def update_dictionary(dictionary_attributes)
481
+ attributes = Utils.transform_attributes(dictionary_attributes)
482
+ http_put("/indexes/#{@uid}/settings/dictionary", attributes)
483
+ end
484
+
485
+ def reset_dictionary
486
+ http_delete("/indexes/#{@uid}/settings/dictionary")
487
+ end
488
+ ### SETTINGS - SEPARATOR TOKENS
489
+
490
+ def separator_tokens
491
+ http_get("/indexes/#{@uid}/settings/separator-tokens")
492
+ end
493
+
494
+ def update_separator_tokens(separator_tokens_attributes)
495
+ attributes = Utils.transform_attributes(separator_tokens_attributes)
496
+ http_put("/indexes/#{@uid}/settings/separator-tokens", attributes)
497
+ end
498
+
499
+ def reset_separator_tokens
500
+ http_delete("/indexes/#{@uid}/settings/separator-tokens")
501
+ end
502
+
503
+ ### SETTINGS - NON SEPARATOR TOKENS
504
+
505
+ def non_separator_tokens
506
+ http_get("/indexes/#{@uid}/settings/non-separator-tokens")
507
+ end
508
+
509
+ def update_non_separator_tokens(non_separator_tokens_attributes)
510
+ attributes = Utils.transform_attributes(non_separator_tokens_attributes)
511
+ http_put("/indexes/#{@uid}/settings/non-separator-tokens", attributes)
512
+ end
513
+
514
+ def reset_non_separator_tokens
515
+ http_delete("/indexes/#{@uid}/settings/non-separator-tokens")
516
+ end
464
517
  end
465
518
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MeiliSearch
4
- VERSION = '0.25.1'
4
+ VERSION = '0.26.0'
5
5
 
6
6
  def self.qualified_version
7
7
  "Meilisearch Ruby (v#{VERSION})"
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.25.1
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty