Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchBuilder is called twice for each request. #3155

Open
jcoyne opened this issue May 14, 2024 · 0 comments
Open

SearchBuilder is called twice for each request. #3155

jcoyne opened this issue May 14, 2024 · 0 comments

Comments

@jcoyne
Copy link
Member

jcoyne commented May 14, 2024

It should only be called once. It appears that uses_json_query_dsl? is the culprit

First call

app/models/search_builder.rb:11:in `add_custom_data_to_query'
blacklight (8.1.0) lib/blacklight/search_builder.rb:151:in `block (2 levels) in processed_parameters'
blacklight (8.1.0) lib/blacklight/search_builder.rb:150:in `each'
blacklight (8.1.0) lib/blacklight/search_builder.rb:150:in `block in processed_parameters'
<internal:kernel>:90:in `tap'
blacklight (8.1.0) lib/blacklight/search_builder.rb:149:in `processed_parameters'
blacklight (8.1.0) lib/blacklight/search_builder.rb:123:in `to_hash'
blacklight (8.1.0) lib/blacklight/search_builder.rb:116:in `[]'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:135:in `uses_json_query_dsl?'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:128:in `search_path'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:24:in `search'
blacklight (8.1.0) app/services/blacklight/search_service.rb:34:in `search_results'
blacklight (8.1.0) app/controllers/concerns/blacklight/catalog.rb:26:in `index' 

Second call

app/models/search_builder.rb:11:in `add_custom_data_to_query'
blacklight (8.1.0) lib/blacklight/search_builder.rb:151:in `block (2 levels) in processed_parameters'
blacklight (8.1.0) lib/blacklight/search_builder.rb:150:in `each'
blacklight (8.1.0) lib/blacklight/search_builder.rb:150:in `block in processed_parameters'
<internal:kernel>:90:in `tap'
blacklight (8.1.0) lib/blacklight/search_builder.rb:149:in `processed_parameters'
blacklight (8.1.0) lib/blacklight/search_builder.rb:123:in `to_hash'
blacklight (8.1.0) lib/blacklight/search_builder.rb:116:in `[]'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:135:in `uses_json_query_dsl?'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:81:in `build_solr_request'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:62:in `block in send_and_receive'
activesupport (7.1.3.2) lib/active_support/benchmarkable.rb:44:in `block in benchmark'
/Users/jcoyne85/.rbenv/versions/3.2.3/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
activesupport (7.1.3.2) lib/active_support/core_ext/benchmark.rb:14:in `ms'
activesupport (7.1.3.2) lib/active_support/benchmarkable.rb:44:in `benchmark'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:61:in `send_and_receive'
blacklight (8.1.0) lib/blacklight/solr/repository.rb:24:in `search'
blacklight (8.1.0) app/services/blacklight/search_service.rb:34:in `search_results'
blacklight (8.1.0) app/controllers/concerns/blacklight/catalog.rb:26:in `index' 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant