redi_search 6.3.0 → 6.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/redi_search/aggregate/clauses/apply.rb +24 -0
- data/lib/redi_search/aggregate/clauses/filter.rb +22 -0
- data/lib/redi_search/aggregate/clauses/group_by.rb +79 -0
- data/lib/redi_search/aggregate/clauses/limit.rb +28 -0
- data/lib/redi_search/aggregate/clauses/load.rb +22 -0
- data/lib/redi_search/aggregate/clauses/sort_by.rb +43 -0
- data/lib/redi_search/aggregate/clauses/verbatim.rb +17 -0
- data/lib/redi_search/aggregate/reducers/average.rb +26 -0
- data/lib/redi_search/aggregate/reducers/count.rb +23 -0
- data/lib/redi_search/aggregate/reducers/distinct_count.rb +26 -0
- data/lib/redi_search/aggregate/reducers/distinctish_count.rb +26 -0
- data/lib/redi_search/aggregate/reducers/max.rb +26 -0
- data/lib/redi_search/aggregate/reducers/min.rb +26 -0
- data/lib/redi_search/aggregate/reducers/quantile.rb +30 -0
- data/lib/redi_search/aggregate/reducers/stdev.rb +26 -0
- data/lib/redi_search/aggregate/reducers/sum.rb +26 -0
- data/lib/redi_search/aggregate/reducers/to_list.rb +26 -0
- data/lib/redi_search/aggregate.rb +104 -0
- data/lib/redi_search/application_clause.rb +37 -0
- data/lib/redi_search/client.rb +5 -4
- data/lib/redi_search/index.rb +4 -0
- data/lib/redi_search/log_subscriber.rb +4 -3
- data/lib/redi_search/model.rb +5 -1
- data/lib/redi_search/schema/tag_field.rb +8 -0
- data/lib/redi_search/search/clauses/highlight.rb +3 -1
- data/lib/redi_search/search/clauses/in_order.rb +2 -0
- data/lib/redi_search/search/clauses/language.rb +1 -0
- data/lib/redi_search/search/clauses/limit.rb +1 -0
- data/lib/redi_search/search/clauses/no_content.rb +2 -0
- data/lib/redi_search/search/clauses/no_stop_words.rb +2 -0
- data/lib/redi_search/search/clauses/return.rb +1 -0
- data/lib/redi_search/search/clauses/slop.rb +1 -0
- data/lib/redi_search/search/clauses/sort_by.rb +1 -0
- data/lib/redi_search/search/clauses/timeout.rb +24 -0
- data/lib/redi_search/search/clauses/verbatim.rb +2 -0
- data/lib/redi_search/search/clauses/with_payloads.rb +17 -0
- data/lib/redi_search/search/clauses/with_scores.rb +2 -0
- data/lib/redi_search/search/clauses/with_sort_keys.rb +17 -0
- data/lib/redi_search/search/clauses.rb +36 -55
- data/lib/redi_search/search/{clauses → queries}/and.rb +1 -1
- data/lib/redi_search/search/{clauses → queries}/boolean.rb +4 -4
- data/lib/redi_search/search/{clauses → queries}/or.rb +1 -1
- data/lib/redi_search/search/{clauses → queries}/where.rb +2 -2
- data/lib/redi_search/search/queries.rb +39 -0
- data/lib/redi_search/search.rb +7 -6
- data/lib/redi_search/version.rb +1 -1
- metadata +30 -8
- data/lib/redi_search/search/clauses/application_clause.rb +0 -31
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RediSearch
|
4
|
-
class Search
|
5
|
-
module Clauses
|
6
|
-
class ApplicationClause
|
7
|
-
include Validatable
|
8
|
-
|
9
|
-
class << self
|
10
|
-
def clause_term(term, **validations)
|
11
|
-
attr_reader term
|
12
|
-
|
13
|
-
validations.each do |validation_type, options|
|
14
|
-
define_validation(term, validation_type, options)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def define_validation(term, type, options)
|
21
|
-
if options.is_a? Hash
|
22
|
-
public_send("validates_#{type}_of", term, **options)
|
23
|
-
else
|
24
|
-
public_send("validates_#{type}_of", term)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|