Skip to content

Commit

Permalink
fix search predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Jun 27, 2023
1 parent 03efe12 commit f9002b1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gem "grpc", force_ruby_platform: true
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "anycable-rails"
gem "pg"
gem "rails", "7.0.5" # , github: "rails/rails",
gem "rails", "7.0.5.1" # , github: "rails/rails",
gem "uri", "0.10.0.1"

# Use sqlite3 as the database for Active Record
Expand Down
123 changes: 62 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,69 +56,69 @@ GEM
action_policy (>= 0.5.0)
graphql (>= 1.9.3)
ruby-next-core (>= 0.10.0)
actioncable (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
actioncable (7.0.5.1)
actionpack (= 7.0.5.1)
activesupport (= 7.0.5.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actionmailbox (7.0.5.1)
actionpack (= 7.0.5.1)
activejob (= 7.0.5.1)
activerecord (= 7.0.5.1)
activestorage (= 7.0.5.1)
activesupport (= 7.0.5.1)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.5)
actionpack (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activesupport (= 7.0.5)
actionmailer (7.0.5.1)
actionpack (= 7.0.5.1)
actionview (= 7.0.5.1)
activejob (= 7.0.5.1)
activesupport (= 7.0.5.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.5)
actionview (= 7.0.5)
activesupport (= 7.0.5)
actionpack (7.0.5.1)
actionview (= 7.0.5.1)
activesupport (= 7.0.5.1)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.5)
actionpack (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
actiontext (7.0.5.1)
actionpack (= 7.0.5.1)
activerecord (= 7.0.5.1)
activestorage (= 7.0.5.1)
activesupport (= 7.0.5.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.5)
activesupport (= 7.0.5)
actionview (7.0.5.1)
activesupport (= 7.0.5.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_importer (0.2.6)
roo
activejob (7.0.5)
activesupport (= 7.0.5)
activejob (7.0.5.1)
activesupport (= 7.0.5.1)
globalid (>= 0.3.6)
activemodel (7.0.5)
activesupport (= 7.0.5)
activerecord (7.0.5)
activemodel (= 7.0.5)
activesupport (= 7.0.5)
activestorage (7.0.5)
actionpack (= 7.0.5)
activejob (= 7.0.5)
activerecord (= 7.0.5)
activesupport (= 7.0.5)
activemodel (7.0.5.1)
activesupport (= 7.0.5.1)
activerecord (7.0.5.1)
activemodel (= 7.0.5.1)
activesupport (= 7.0.5.1)
activestorage (7.0.5.1)
actionpack (= 7.0.5.1)
activejob (= 7.0.5.1)
activerecord (= 7.0.5.1)
activesupport (= 7.0.5.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.5)
activesupport (7.0.5.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -389,7 +389,7 @@ GEM
mini_magick (4.11.0)
mini_mime (1.1.2)
mini_portile2 (2.8.2)
minitest (5.18.0)
minitest (5.18.1)
msgpack (1.4.5)
msgpack (1.4.5-java)
multi_json (1.15.0)
Expand All @@ -399,7 +399,7 @@ GEM
net-http (0.2.0)
net-protocol
uri
net-imap (0.3.4)
net-imap (0.3.6)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -463,37 +463,38 @@ GEM
nio4r (~> 2.0)
puma (6.0.0-java)
nio4r (~> 2.0)
racc (1.6.2)
racc (1.6.2-java)
racc (1.7.1)
racc (1.7.1-java)
rack (2.2.7)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-protection (2.2.0)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.5)
actioncable (= 7.0.5)
actionmailbox (= 7.0.5)
actionmailer (= 7.0.5)
actionpack (= 7.0.5)
actiontext (= 7.0.5)
actionview (= 7.0.5)
activejob (= 7.0.5)
activemodel (= 7.0.5)
activerecord (= 7.0.5)
activestorage (= 7.0.5)
activesupport (= 7.0.5)
rails (7.0.5.1)
actioncable (= 7.0.5.1)
actionmailbox (= 7.0.5.1)
actionmailer (= 7.0.5.1)
actionpack (= 7.0.5.1)
actiontext (= 7.0.5.1)
actionview (= 7.0.5.1)
activejob (= 7.0.5.1)
activemodel (= 7.0.5.1)
activerecord (= 7.0.5.1)
activestorage (= 7.0.5.1)
activesupport (= 7.0.5.1)
bundler (>= 1.15.0)
railties (= 7.0.5)
railties (= 7.0.5.1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.5)
actionpack (= 7.0.5)
activesupport (= 7.0.5)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.5.1)
actionpack (= 7.0.5.1)
activesupport (= 7.0.5.1)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -622,7 +623,7 @@ GEM
temple (0.8.2)
thor (1.2.2)
tilt (2.0.10)
timeout (0.3.2)
timeout (0.4.0)
timezone (1.3.15)
truemail (2.6.6)
simpleidn (~> 0.2.1)
Expand Down Expand Up @@ -739,7 +740,7 @@ DEPENDENCIES
pry
puma (~> 6.0)
rack-cors (~> 1.0)
rails (= 7.0.5)
rails (= 7.0.5.1)
ransack
redis (~> 4.0)
redis-namespace (~> 1.8)
Expand Down
19 changes: 9 additions & 10 deletions app/graphql/mutations/predicates/search_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ class Predicates::SearchPredicate < Mutations::BaseMutation
end

def app_users(app, per, page)
@app_users = @segment.execute_query
if Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" && app.searchkick_enabled?
@app_users = @segment.es_search(page, per).includes(taggings: :tag)
else
@segment.execute_query
.page(page)
.per(per)
.includes(taggings: :tags)
.fast_page
end
@app_users = if Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" && app.searchkick_enabled?
@segment.es_search(page, per).includes(taggings: :tag)
else
@segment.execute_query
.page(page)
.per(per)
.includes(taggings: :tag)
.fast_page
end
end

argument :app_key, String, required: true
Expand Down

0 comments on commit f9002b1

Please sign in to comment.