searchkick 6.0.2 → 6.0.3

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: 91941f04c724b051532a882173be99f4cd53a51ba1dac8b5b68807d2aee3d002
4
- data.tar.gz: 1c5ed483a01e65ec2cb56dcc2f377cedaba1887b40f82ba40cb90bdb90055a21
3
+ metadata.gz: cf43f99e5f6ced971320bdf629e3454e7c8f2fb111c64a0967182ef51aa942d0
4
+ data.tar.gz: a891ac1f9b25f25efc47836887a68a261659fe87e2754cf203f3210b855b2e31
5
5
  SHA512:
6
- metadata.gz: 438bad554db6815bfe582054d62933885c13d3b1ad28b7feea7c70709159eb7d168087aac9317658a86a274833c0832851497f205adf49e6f52aa97ff328291e
7
- data.tar.gz: fd3481046430357d460a70e35dff63da66207138e21effbbe1793d5318ff8badb2168de4e7dc258ae49f2aa2a28b4c15df4c7046de3ef8cf14f1f601eae8d7cb
6
+ metadata.gz: 2a5a20df662acbcea24702c9a5c22327e54ba9bd223896fcfcc9886fd3087edbbf59b8d806a4248e4f65b7e0df530f90788bf9d54bbce796ec5f267f83fd2caf
7
+ data.tar.gz: 54567b34c84d4444d12d71546d13c2c8569b1dfe710dbe0de0662cde80f16973afe37125c931733787df729bdb853f9c34a66ceb1a094962b84f4c16c79f42af
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 6.0.3 (2026-01-06)
2
+
3
+ - Fixed `inspect` method for `Relation`
4
+
1
5
  ## 6.0.2 (2025-10-24)
2
6
 
3
7
  - Fixed `as_json` method for `HashWrapper`
@@ -22,6 +26,7 @@
22
26
  - Removed default quantization for `knn` option for Elasticsearch 8.14+
23
27
  - Removed `results` method (use `to_a` instead)
24
28
  - Removed `execute` option and method (no longer needed)
29
+ - Removed `options` method (use individual methods instead)
25
30
  - Removed dependency on Hashie
26
31
  - Deprecated `conversions` option in favor of `conversions_v2`
27
32
  - Dropped support for Elasticsearch 7 and OpenSearch 1
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2025 Andrew Kane
1
+ Copyright (c) 2013-2026 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1182,7 +1182,7 @@ And to search, use:
1182
1182
  ```ruby
1183
1183
  Animal.search("*") # all animals
1184
1184
  Dog.search("*") # just dogs
1185
- Animal.search("*").type(Dog, Cat) # just cats and dogs
1185
+ Animal.search("*").type(Cat, Dog) # just cats and dogs
1186
1186
  ```
1187
1187
 
1188
1188
  **Notes:**
@@ -1547,30 +1547,6 @@ See [Production Rails](https://github.com/ankane/production_rails) for other goo
1547
1547
 
1548
1548
  ## Performance
1549
1549
 
1550
- ### JSON Generation
1551
-
1552
- Increase performance with faster JSON generation. Add to your Gemfile:
1553
-
1554
- ```ruby
1555
- gem "json", ">= 2.10.2"
1556
- ```
1557
-
1558
- And create an initializer with:
1559
-
1560
- ```ruby
1561
- class SearchSerializer
1562
- CODER = JSON::Coder.new { |v, _| v.is_a?(Time) ? v.as_json : v }
1563
-
1564
- def dump(object)
1565
- CODER.generate(object)
1566
- end
1567
- end
1568
-
1569
- Elasticsearch::API.settings[:serializer] = SearchSerializer.new
1570
- # or
1571
- OpenSearch::API.settings[:serializer] = SearchSerializer.new
1572
- ```
1573
-
1574
1550
  ### Persistent HTTP Connections
1575
1551
 
1576
1552
  Significantly increase performance with persistent HTTP connections. Add [Typhoeus](https://github.com/typhoeus/typhoeus) to your Gemfile and it’ll automatically be used.
@@ -2311,7 +2287,7 @@ Product.search("apples").where(in_stock: true).limit(10).offset(50)
2311
2287
 
2312
2288
  All existing options can be used as methods, or you can continue to use the existing API.
2313
2289
 
2314
- This release also significantly improves the performance of searches when using conversions. To upgrade without downtime, add `conversions_v2` to your model and an additional field to `search_data`:
2290
+ This release also significantly improves the performance of searches when using conversions. To upgrade conversions without downtime, add `conversions_v2` to your model and an additional field to `search_data`:
2315
2291
 
2316
2292
  ```ruby
2317
2293
  class Product < ApplicationRecord
@@ -359,7 +359,7 @@ module Searchkick
359
359
  end
360
360
 
361
361
  # https://gist.github.com/jarosan/3124884
362
- # http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/
362
+ # https://www.elastic.co/blog/changing-mapping-with-zero-downtime/
363
363
  def full_reindex(relation, import: true, resume: false, retain: false, mode: nil, refresh_interval: nil, scope: nil, wait: nil, job_options: nil)
364
364
  raise ArgumentError, "wait only available in :async mode" if !wait.nil? && mode != :async
365
365
  raise ArgumentError, "Full reindex does not support :queue mode - use :async mode instead" if mode == :queue
@@ -524,7 +524,7 @@ module Searchkick
524
524
 
525
525
  dynamic_fields = {
526
526
  # analyzed field must be the default field for include_in_all
527
- # http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/
527
+ # https://www.elastic.co/guide/reference/mapping/multi-field-type/
528
528
  # however, we can include the not_analyzed field in _all
529
529
  # and the _all index analyzer will take care of it
530
530
  "{name}" => keyword_mapping
@@ -544,7 +544,7 @@ module Searchkick
544
544
  end
545
545
  end
546
546
 
547
- # http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/
547
+ # https://www.elastic.co/guide/reference/mapping/multi-field-type/
548
548
  multi_field = dynamic_fields["{name}"].merge(fields: dynamic_fields.except("{name}"))
549
549
 
550
550
  mappings = {
@@ -578,7 +578,7 @@ module Searchkick
578
578
  # https://groups.google.com/forum/#!topic/elasticsearch/p7qcQlgHdB8
579
579
  # TODO use a snowball stemmer on synonyms when creating the token filter
580
580
 
581
- # http://elasticsearch-users.115913.n3.nabble.com/synonym-multi-words-search-td4030811.html
581
+ # https://discuss.elastic.co/t/synonym-multi-words-search/10964
582
582
  # I find the following approach effective if you are doing multi-word synonyms (synonym phrases):
583
583
  # - Only apply the synonym expansion at index time
584
584
  # - Don't have the synonym filter applied search
@@ -22,7 +22,7 @@ module Searchkick
22
22
 
23
23
  # same as Active Record
24
24
  def inspect
25
- entries = results.first(11).map!(&:inspect)
25
+ entries = private_execute.first(11).map!(&:inspect)
26
26
  entries[10] = "..." if entries.size == 11
27
27
  "#<#{self.class.name} [#{entries.join(', ')}]>"
28
28
  end
@@ -644,6 +644,16 @@ module Searchkick
644
644
  Results.new(nil, nil, nil).respond_to?(...) || super
645
645
  end
646
646
 
647
+ # TODO uncomment in 7.0
648
+ # def to_json(...)
649
+ # private_execute.to_a.to_json(...)
650
+ # end
651
+
652
+ # TODO uncomment in 7.0
653
+ # def as_json(...)
654
+ # private_execute.to_a.as_json(...)
655
+ # end
656
+
647
657
  def to_yaml
648
658
  private_execute.to_a.to_yaml
649
659
  end
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "6.0.2"
2
+ VERSION = "6.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
- rubygems_version: 3.6.9
80
+ rubygems_version: 4.0.3
81
81
  specification_version: 4
82
82
  summary: Intelligent search made easy with Rails and Elasticsearch or OpenSearch
83
83
  test_files: []