searchkick 6.0.0 → 6.0.1
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +86 -17
- data/lib/searchkick/hash_wrapper.rb +4 -0
- data/lib/searchkick/relation.rb +1 -1
- data/lib/searchkick/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ab26ce5fc3070a9d192dfae97f5f0fbf7ae98757973b3309582294d48873e87
|
|
4
|
+
data.tar.gz: 5841a4e05ba26647dec8fe682f6dbf154164060662054eea3ac2e57364535aec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c8c7e037662b690f3ae3c04690f1fda2e9659fc8af6d3ded3f9b12d5e1551eb7f26eab5bfd48170edbcd112f86d59296693a139ccf20387a2d9ad0aa83829da5
|
|
7
|
+
data.tar.gz: 004f3464ad8ccdaa2d7242f333d93c630c902ce670d25386d692afe324f151ee0c5c754b958e813cb1ce19447568e2bad2057545fcfebcc752d27346d66009db
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 6.0.1 (2025-10-24)
|
|
2
|
+
|
|
3
|
+
- Fixed `to_json` method for `HashWrapper`
|
|
4
|
+
|
|
1
5
|
## 6.0.0 (2025-10-19)
|
|
2
6
|
|
|
3
7
|
- Added new query builder API (similar to Active Record)
|
|
@@ -12,6 +16,7 @@
|
|
|
12
16
|
- Changed async reindex to use ranges for numeric primary keys with Active Record
|
|
13
17
|
- Fixed error with `case_sensitive` option and synonyms
|
|
14
18
|
- Removed default quantization for `knn` option for Elasticsearch 8.14+
|
|
19
|
+
- Removed `results` method (use `to_a` instead)
|
|
15
20
|
- Removed `execute` option and method (no longer needed)
|
|
16
21
|
- Removed dependency on Hashie
|
|
17
22
|
- Deprecated `conversions` option in favor of `conversions_v2`
|
data/README.md
CHANGED
|
@@ -107,24 +107,11 @@ fields(:name, :brand)
|
|
|
107
107
|
Where
|
|
108
108
|
|
|
109
109
|
```ruby
|
|
110
|
-
where(
|
|
111
|
-
expires_at: {gt: Time.now}, # lt, gte, lte also available
|
|
112
|
-
orders_count: 1..10, # equivalent to {gte: 1, lte: 10}
|
|
113
|
-
aisle_id: [25, 30], # in
|
|
114
|
-
store_id: {not: 2}, # not
|
|
115
|
-
aisle_id: {not: [25, 30]}, # not in
|
|
116
|
-
user_ids: {all: [1, 3]}, # all elements in array
|
|
117
|
-
category: {like: "%frozen%"}, # like
|
|
118
|
-
category: {ilike: "%frozen%"}, # ilike
|
|
119
|
-
category: /frozen .+/, # regexp
|
|
120
|
-
category: {prefix: "frozen"}, # prefix
|
|
121
|
-
store_id: {exists: true}, # exists
|
|
122
|
-
_not: {store_id: 1}, # negate a condition
|
|
123
|
-
_or: [{in_stock: true}, {backordered: true}],
|
|
124
|
-
_and: [{in_stock: true}, {backordered: true}]
|
|
125
|
-
)
|
|
110
|
+
where(store_id: 1, expires_at: Time.now..)
|
|
126
111
|
```
|
|
127
112
|
|
|
113
|
+
[These types of filters are supported](#filtering)
|
|
114
|
+
|
|
128
115
|
Order
|
|
129
116
|
|
|
130
117
|
```ruby
|
|
@@ -184,6 +171,86 @@ results.response
|
|
|
184
171
|
|
|
185
172
|
**Note:** By default, Elasticsearch and OpenSearch [limit paging](#deep-paging) to the first 10,000 results for performance. This applies to the total count as well.
|
|
186
173
|
|
|
174
|
+
### Filtering
|
|
175
|
+
|
|
176
|
+
Equal
|
|
177
|
+
|
|
178
|
+
```ruby
|
|
179
|
+
where(store_id: 1)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Not equal
|
|
183
|
+
|
|
184
|
+
```ruby
|
|
185
|
+
where.not(store_id: 2)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Greater than (`gt`), less than (`lt`), greater than or equal (`gte`), less than or equal (`lte`)
|
|
189
|
+
|
|
190
|
+
```ruby
|
|
191
|
+
where(expires_at: {gt: Time.now})
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Range
|
|
195
|
+
|
|
196
|
+
```ruby
|
|
197
|
+
where(orders_count: 1..10)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
In
|
|
201
|
+
|
|
202
|
+
```ruby
|
|
203
|
+
where(aisle_id: [25, 30])
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Not in
|
|
207
|
+
|
|
208
|
+
```ruby
|
|
209
|
+
where.not(aisle_id: [25, 30])
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Contains all
|
|
213
|
+
|
|
214
|
+
```ruby
|
|
215
|
+
where(user_ids: {all: [1, 3]})
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Like
|
|
219
|
+
|
|
220
|
+
```ruby
|
|
221
|
+
where(category: {like: "%frozen%"})
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Case-insensitive like
|
|
225
|
+
|
|
226
|
+
```ruby
|
|
227
|
+
where(category: {ilike: "%frozen%"})
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Regular expression
|
|
231
|
+
|
|
232
|
+
```ruby
|
|
233
|
+
where(category: /frozen .+/)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Prefix
|
|
237
|
+
|
|
238
|
+
```ruby
|
|
239
|
+
where(category: {prefix: "frozen"})
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Exists
|
|
243
|
+
|
|
244
|
+
```ruby
|
|
245
|
+
where(store_id: {exists: true})
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Combine filters with OR
|
|
249
|
+
|
|
250
|
+
```ruby
|
|
251
|
+
where(_or: [{in_stock: true}, {backordered: true}])
|
|
252
|
+
```
|
|
253
|
+
|
|
187
254
|
### Boosting
|
|
188
255
|
|
|
189
256
|
Boost important fields
|
|
@@ -1492,8 +1559,10 @@ And create an initializer with:
|
|
|
1492
1559
|
|
|
1493
1560
|
```ruby
|
|
1494
1561
|
class SearchSerializer
|
|
1562
|
+
CODER = JSON::Coder.new { |v, _| v.is_a?(Time) ? v.as_json : v }
|
|
1563
|
+
|
|
1495
1564
|
def dump(object)
|
|
1496
|
-
|
|
1565
|
+
CODER.generate(object)
|
|
1497
1566
|
end
|
|
1498
1567
|
end
|
|
1499
1568
|
|
data/lib/searchkick/relation.rb
CHANGED
data/lib/searchkick/version.rb
CHANGED