SearchBuilder is called twice for each request.
Opened this issue · 0 comments
jcoyne commented
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'