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

sort param field can't be found: pub_date_sort #1348

Open
domino666666 opened this issue Dec 14, 2015 · 5 comments
Open

sort param field can't be found: pub_date_sort #1348

domino666666 opened this issue Dec 14, 2015 · 5 comments

Comments

@domino666666
Copy link

domino666666 commented Dec 14, 2015

I'm trying to run Solr without Jetty and I get an issue when I run blacklight "sort param field can't be found: pub_date_sort". Any help would be greatly appreciated?

Blacklight::Exceptions::InvalidRequest in CatalogController#index
RSolr::Error::Http - 400 Bad Request Error:

{'responseHeader'=>{
  'status'=>400, 'QTime'=>6,
  'params'=>{
    'facet'=>'true', 'sort'=>'score desc,pub_date_sort desc,title_sort asc',
    'facet.query'=>['pub_date:[2010 TO _]','pub_date:[2005 TO *]','pub_date:[1990 TO *]'],
    'f.subject_topic_facet.facet.limit'=>'21',
    'f.language_facet.facet.limit'=>'11',
    'facet.field'=>['format', '{!ex=pub_date_single}pub_date', 'subject_topic_facet', 'language_facet', 'lc_1letter_facet', 'subject_geo_facet', 'subject_era_facet'],
    'qt'=>'search', 'wt'=>'ruby', 'facet.pivot'=>'format,language_facet', 'rows'=>'10'}
  },
  'error'=>{'msg'=>'sort param field can\'t be found: pub_date_sort', 'code'=>400}
}
 URI: http://127.0.0.1:8983/solr/blacklight-core/select?wt=ruby&qt=search&facet.field=format&facet.field=%7B%21ex%3Dpub_date_single%7Dpub_date&facet.field=subject_topic_facet&facet.field=language_facet&facet.field=lc_1letter_facet&facet.field=subject_geo_facet&facet.field=subject_era_facet&facet.query=pub_date%3A%5B2010+TO+_%5D&facet.query=pub_date%3A%5B2005+TO+_%5D&facet.query=pub_date%3A%5B1990+TO+_%5D&facet.pivot=format%2Clanguage_facet&&&rows=10&facet=true&f.subject_topic_facet.facet.limit=21&f.language_facet.facet.limit=11&sort=score+desc%2C+pub_date_sort+desc%2C+title_sort+asc 
Backtrace: 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rsolr-1.0.13/lib/rsolr/client.rb:284:in `adapt_response' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rsolr-1.0.13/lib/rsolr/client.rb:190:in`execute' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rsolr-1.0.13/lib/rsolr/client.rb:176:in `send_and_receive' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/blacklight-5.17.0/lib/blacklight/solr/repository.rb:44:in`block in send_and_receive' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.14/lib/active_support/benchmarkable.rb:41:in `block in benchmark' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.14/lib/active_support/core_ext/benchmark.rb:12:in`block in ms' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.14/lib/active_support/core_ext/benchmark.rb:12:in`ms' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.14/lib/active_support/benchmarkable.rb:41:in `benchmark' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/blacklight-5.17.0/lib/blacklight/solr/repository.rb:42:in`send_and_receive' 
C:/pgm/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/blacklight-5.17.0/lib/blacklight/solr/repository.rb:28:in `search'
@jhriv
Copy link

jhriv commented Jan 18, 2017

Setting up via "the hard way" results in the same thing.

RSolr::Error::Http - 400 Bad Request Error: 'sort param field can\'t be found: pub_date_sort','code'=>400}} URI: http://127.0.0.1:8983/solr/blacklight-core/select?wt=ruby&facet.field=format&facet.field=%7B%21ex%3Dpub_date_single%7Dpub_date&facet.field=subject_topic_facet&facet.field=language_facet&facet.field=lc_1letter_facet&facet.field=subject_geo_facet&facet.field=subject_era_facet&facet.query=pub_date%3A%5B2012+TO+*%5D&facet.query=pub_date%3A%5B2007+TO+*%5D&facet.query=pub_date%3A%5B1992+TO+*%5D&facet.pivot=format%2Clanguage_facet&&&rows=10&facet=true&f.subject_topic_facet.facet.limit=21&f.language_facet.facet.limit=11&sort=score+desc%2C+pub_date_sort+desc%2C+title_sort+asc Backtrace: /var/lib/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:288:in `adapt_response' /var/lib/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:189:in `execute' /var/lib/gems/2.2.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:175:in `send_and_receive' /var/lib/gems/2.2.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:38:in `block in send_and_receive' /var/lib/gems/2.2.0/gems/activesupport-5.0.1/lib/active_support/benchmarkable.rb:41:in `block in benchmark' /var/lib/gems/2.2.0/gems/activesupport-5.0.1/lib/active_support/core_ext/benchmark.rb:12:in `block in ms' /usr/lib/ruby/2.2.0/benchmark.rb:303:in `realtime' /var/lib/gems/2.2.0/gems/activesupport-5.0.1/lib/active_support/core_ext/benchmark.rb:12:in `ms' /var/lib/gems/2.2.0/gems/activesupport-5.0.1/lib/active_support/benchmarkable.rb:41:in `benchmark' /var/lib/gems/2.2.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:36:in `send_and_receive' /var/lib/gems/2.2.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:22:in `search'

The test data seems to be missing any pub_date_sort records.

Extracted source (around line #49):

      raise Blacklight::Exceptions::ECONNREFUSED, "Unable to connect to Solr instance using #{connection.inspect}: #{e.inspect}"
    rescue RSolr::Error::Http => e
      raise Blacklight::Exceptions::InvalidRequest, e.message
    end

    protected

@jhriv
Copy link

jhriv commented Jan 18, 2017

Further troubleshooting - the rake solr:marc:index_test_data creates a schema that lacks pub_date_sort which is clearly in solr/conf/schema.xml and has applicable data in solr/sample_solr_documents.yml. Manually adding the pub_date_sort field

curl -X POST -H 'Content-type:application/json' --data-binary '{
   "add-field":{
"name":"pub_date_sort",
"type":"tint"
}
}' http://localhost:8983/solr/blacklight-core/schema

deleting all current data, then re-importing the data via the rake task shows pub_date_sort in the schema but there still lacks any data for pub_date_sort.

grep blacklight Gemfile

gem "blacklight", "~> 6.0"
gem 'blacklight-marc', '~> 6.1'

gem list blacklight

*** LOCAL GEMS ***

blacklight (6.7.3)
blacklight-marc (6.1.1)

Could any of this be because I am using a full Solr instance instead of solr-wrapper, and still running in :development environment?

@joelakes
Copy link

Hi,

Did you ever find a solution for this?

Thanks...

@jhriv
Copy link

jhriv commented Oct 22, 2018

Did you ever find a solution for this?

I don't recall finding a solution. I am pretty certain that project got shelved, as we moved onto other things.

@barmintor barmintor added this to the 6.x milestone Oct 24, 2018
@barmintor
Copy link
Contributor

If I read this error correctly, there are 2 possible fixes here:

  1. Add the Solr field definition to the schema, update the MarcIndexer model to use pub_date_sort instead of pub_date, and reindex
  2. Change the CatalogController to use pub_date to sort

There's a related BL7.0 issue regarding the field names, but there they are pub_date_si and pub_date, but Solr 7 appears to be more generous with the errors.

@carolyncole carolyncole removed this from the 6.x milestone Oct 5, 2022
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

No branches or pull requests

5 participants