RSolr::Error::Http - 400 Bad Request Error: 'can not sort on multivalued field: title_sort','code'=>400}}

456 views
Skip to first unread message

Layale Bassil

unread,
Feb 22, 2017, 12:57:17 PM2/22/17
to Blacklight Development
Hello All,

I have been trying to make blacklight work on Centos using latest Solr 6.4.1 and following the quickstart guide using both the easy way and hard way. I am currently getting the above error when I try to open the deployed blacklight: 

RSolr::Error::Http - 400 Bad Request Error: 'can not sort on multivalued field: title_sort','code'=>400}}.


I have no idea how can I stop the sorting by title_sort field and how the sorting fields are defined and where to change them. I have create the blacklight-core on Solr and imported to it the test data (rake solr:marc:index_test_data).

I also have a field facet.field=lc_1letter_facet which also does not exist in the schema.

I appreciate any help to make it work as I have been trying for days with no luck!

Any suggestion is highly appreciated.
Regards.

Mark A. Matienzo

unread,
Feb 22, 2017, 2:00:50 PM2/22/17
to blacklight-...@googlegroups.com
Hi Layale,

Thanks for your message - I'm sorry to hear that you're having difficulty. I just generated a new application using the "easy way" from scratch, indexed the test data, and can confirm that the application works after started with title sort set up.

Can you let us know if you've taken any additional steps, such as indexing additional data or modifying your application in any way? 

Best,
Mark


--
You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blacklight-development+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Layale Bassil

unread,
Feb 23, 2017, 2:25:44 AM2/23/17
to Blacklight Development
Hello Mark,

Thank you for the prompt response. I have repeated everything now and still unable to make it work.

I have the latest Solr 6.4.1 with Ruby 2.4 and Rails 5.0.1. I don't know if the versions of the prerequisites used affect the outcome. I will list the exact steps I followed and please do the same in case I am doing anything wrong:

1-  mkdir projects
$ cd projects
$ rails new search_app -m https://raw.github.com/projectblacklight/blacklight/master/template.demo.rb
cd search_app

2- I ran Solr using the start command from the bin ./start solr
3- Indexed the sample data using: rake solr:marc:index_test_data and I got the following output which means 30 new records have been added to the backlight-core:

2017-02-23T09:12:59+02:00  INFO    Indexer with 1 processing threads, reader: Traject::MarcReader and writer: Traject::SolrJsonWriter
2017-02-23T09:13:00+02:00  INFO Traject::SolrJsonWriter sending commit to solr at url http://127.0.0.1:8983/solr/blacklight-core/update/json...
2017-02-23T09:13:01+02:00  INFO finished Indexer#process: 30 records in 1.742 seconds; 17.2 records/second overall.

4- I ran the application using the following command because just using rails server did not work: bundle exec rails server Puma -b 0.0.0.0 -p 3000

When I access the application I am getting the sorting error related to having multi-valued sort field title_sort. This is the exact error:

RSolr::Error::Http - 400 Bad Request Error: 'can not sort on multivalued field: title_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: /usr/local/rvm/gems/ruby-2.4.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:288:in `adapt_response' /usr/local/rvm/gems/ruby-2.4.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:189:in `execute' /usr/local/rvm/gems/ruby-2.4.0/gems/rsolr-1.1.2/lib/rsolr/client.rb:175:in `send_and_receive' /usr/local/rvm/gems/ruby-2.4.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:38:in `block in send_and_receive' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/benchmarkable.rb:41:in `block in benchmark' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/benchmark.rb:12:in `block in ms' /usr/local/rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/benchmark.rb:308:in `realtime' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/benchmark.rb:12:in `ms' /usr/local/rvm/gems/ruby-2.4.0/gems/activesupport-5.0.1/lib/active_support/benchmarkable.rb:41:in `benchmark' /usr/local/rvm/gems/ruby-2.4.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:36:in `send_and_receive' /usr/local/rvm/gems/ruby-2.4.0/gems/blacklight-6.7.3/lib/blacklight/solr/repository.rb:22:in `search'


What do you think? How can I specify the sorting fields or how can I edit them? These are the exact steps I did, I have not done any additional steps. Do you think Solr's version affects the outcome?

Please advise.
Thanks again,
Regards.

Jack Reed

unread,
Feb 23, 2017, 7:26:56 AM2/23/17
to blacklight-...@googlegroups.com

Hi Layale,

 

Looks like you are running Solr using the bin ./start solr from an install already on the machine. This should be fine, but first needs to be configured with the expected schema.xml and solrconfig.xml from Blacklight. Were you able to configure Solr for that?

 

bundle exec solr_wrapper

 

will spin up and configure solr for you automatically. This works great for development, but shouldn’t be used in production scenarios.

 

Instead of bin ./start solr, try using the Solr command from solr_wrapper “bundle exec solr_wrapper” to see if that works for you.

 

Best,

Jack

--

You received this message because you are subscribed to the Google Groups "Blacklight Development" group.

To unsubscribe from this group and stop receiving emails from it, send an email to blacklight-develo...@googlegroups.com.

Layale Bassil

unread,
Feb 23, 2017, 7:38:52 AM2/23/17
to Blacklight Development
Hello again Jack,

Well you are right, I am running Solr 6.4.1 from the bin ./start solr because when I ran Solr using the bundle exec solr_wrapper command I got the following error related to permissions:

Starting Solr 6.4.1 on port 8983 ... /usr/local/rvm/gems/ruby-2.4.0/gems/solr_wrapper-0.21.0/lib/solr_wrapper/instance.rb:356:in `exec': Failed to execute solr start: WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting. (RuntimeError)
         Please consult the Reference Guide. To override this check, start with argument '-force'
. Further information may be available in /tmp/solr-6.4.1/logs
        from /usr/local/rvm/gems/ruby-2.4.0/gems/solr_wrapper-0.21.0/lib/solr_wrapper/instance.rb:74:in `start'
        from /usr/local/rvm/gems/ruby-2.4.0/gems/solr_wrapper-0.21.0/lib/solr_wrapper/instance.rb:63:in `wrap'
        from /usr/local/rvm/gems/ruby-2.4.0/gems/solr_wrapper-0.21.0/exe/solr_wrapper:113:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.4.0/bin/solr_wrapper:22:in `load'
        from /usr/local/rvm/gems/ruby-2.4.0/bin/solr_wrapper:22:in `<main>'
        from /usr/local/rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'

I don't know how can I make it work. What do you think?

Thanks.

On Wednesday, February 22, 2017 at 7:57:17 PM UTC+2, Layale Bassil wrote:

Jack Reed

unread,
Feb 23, 2017, 7:51:34 AM2/23/17
to blacklight-...@googlegroups.com

Are you able to run the command as a different user than root?

 

If not, you could start solr using the bin solr start method and configure it manually.

 

bin/solr create –c blacklight-core -d {dir to blacklight} /solr/conf

 

Checkout this SO answer http://stackoverflow.com/a/32923885

 

Best,

Jack

 

From: <blacklight-...@googlegroups.com> on behalf of Layale Bassil <lay...@gmail.com>


Reply-To: "blacklight-...@googlegroups.com" <blacklight-...@googlegroups.com>
Date: Thursday, February 23, 2017 at 7:38 AM
To: Blacklight Development <blacklight-...@googlegroups.com>

--

Layale Bassil

unread,
Feb 23, 2017, 8:28:15 AM2/23/17
to Blacklight Development
Hello Jack,

I had already done this and was able to make it work after removing the title_sort from the sort fields in the config files. I dont know why the schema is not being create properly. 

When I deleted the blacklight-core does it get cashed? Does it take the same schema if I recreate it?

In any event I was able to make it work but I have a new problem now: when I search and get hits, if I click on one of the hits I get redirected to the page that is supposed to display the record but with the following message:

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.


The url is supposed to be correct as follows: [solr IP]/catalog/2001417245 where 2001417245 is the id.


What can I do now?


Thanks again!


On Wednesday, February 22, 2017 at 7:57:17 PM UTC+2, Layale Bassil wrote:

Jack Reed

unread,
Feb 23, 2017, 9:02:33 AM2/23/17
to blacklight-...@googlegroups.com

It may be worth looking into the Rails logs here to diagnose what is going on. What query to solr is the Rails app making? What happens when you make a similar query to Solr directly?

 

Ø  When I deleted the blacklight-core does it get cashed? Does it take the same schema if I recreate it?

 

I think this all depends on how you create/delete the core. Can you navigate successfully to the Solr admin UI? Usually localhost:8983/solr .

 

It sounds like you may still have Solr configuration/data issues.

 

-Jack

 

From: <blacklight-...@googlegroups.com> on behalf of Layale Bassil <lay...@gmail.com>


Reply-To: "blacklight-...@googlegroups.com" <blacklight-...@googlegroups.com>
Date: Thursday, February 23, 2017 at 8:28 AM
To: Blacklight Development <blacklight-...@googlegroups.com>

--

Layale Bassil

unread,
Feb 23, 2017, 9:12:34 AM2/23/17
to Blacklight Development
Hello,

Well i have checked the log file under the blacklight app folder /log/development.log and I am seeing the following:

Started GET "/catalog/43037890" for 192.168.100.173 at 2017-02-23 11:32:38 +0200
Processing by CatalogController#show as HTML
  Parameters: {"id"=>"43037890"}
Solr query: get select {:qt=>"document", :id=>"43037890"}
Solr fetch (10.0ms)
  Rendering public/404.html
  Rendered public/404.html (0.9ms)
Completed 404 Not Found in 27ms (Views: 12.0ms | ActiveRecord: 0.0ms)


What is missing and what is wrong? How can I know what the blacklight is calling when I access the URL http://192.168.100.253:3000/catalog/43037890?

What else can I try?

Thanks again and again.
Regards.

On Wednesday, February 22, 2017 at 7:57:17 PM UTC+2, Layale Bassil wrote:

Chris Beer

unread,
Feb 23, 2017, 11:16:50 AM2/23/17
to blacklight-...@googlegroups.com
Solr is traditionally configured with solrconfig.xml and schema.xml files. Blacklight distributes a set of files that work with its out-of-the-box configuration [1]. This configuration is important because it configures the various Solr fields to behave in particular ways (e.g. *_sort fields are single-valued, or there's a 'document' request handler for retrieving single items by id).

Although Blacklight can work with most (or any?) solr configuration, if you want to make local changes, you need to configure your CatalogController appropriately.

It seems like you're interested in getting Blacklight up and running using the data and configuration we distribute for evaluation purposes. I'd encourage you to use the solr configurations we offer to make that as painless as possible. From the problems you describe, I suspect you are still using alternative configurations.

I believe Jack has offered several good suggestions for how to get started using the example configurations we distribute. The easiest, in my mind, is to use solr_wrapper [1], which will handle the Solr configuration for you. At the very least, it would be helpful to try solr_wrapper [2] to ensure things work in an environment that helps isolate some of the variables, and may also serve as a helpful point of comparison for your local version. 


Hope that’s helpful,
Chris


[1] Noting that solr_wrapper is only good for development and testing, and is intentionally not designed for production use
[2] And, yes, I’d heed the warning about not running as root. Neither Rails nor Solr need to be run as privileged users.


Layale Bassil

unread,
Feb 27, 2017, 11:32:50 AM2/27/17
to Blacklight Development
Hello Chris,

Thank you so much for your support. I have ran the solr_wrapper command using a different user (other than the root) and everything worked properly. Thank you again!

Now I need to make blacklight connect to my DSpace instance. How can I do that? Any idea what library systems others are using with Blacklight? This is very essential to me now being able to make blacklight work on top of my DSpace.

Your help is highly appreciated.
Thank you,
Regards.

On Wednesday, February 22, 2017 at 7:57:17 PM UTC+2, Layale Bassil wrote:

Nayema Nasrin

unread,
Mar 31, 2023, 1:20:07 PM3/31/23
to Blacklight Development
Hi I am trying to install geoblacklght. while running rake geoblacklight:server I am getting following error. 

$ rake geoblacklight:server

Solr server running: http://localhost:8983/solr/#/blacklight-core

^C to stop
 
Indexing - Local test fixtures
=> Booting Puma
=> Rails 7.0.4.3 application starting in development
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.6.5 (ruby 3.2.0-p0) ("Birdie's Version")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 18029
* Listening on http://127.0.0.1:3000
* Listening on http://[::1]:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2023-03-29 11:45:21 +0530
  ActiveRecord::SchemaMigration Pluck (0.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
Processing by CatalogController#index as HTML
Completed 500 Internal Server Error in 48ms (ActiveRecord: 0.0ms | Allocations: 21118)


 
Blacklight::Exceptions::InvalidRequest (RSolr::Error::Http - 400 Bad Request
Error: undefined field: "pub_date_ssim"


So I have tried with bundle wrapper but still getting error.

while running following command:
$ bundle exec solr_wrapper

I am getting following error:
Starting Solr 9.2.0 on port 8983 ... bundler: failed to load command: solr_wrapper (/home/admin1/.rbenv/versions/3.2.0/bin/solr_wrapper)
/home/admin1/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/solr_wrapper-4.0.2/lib/solr_wrapper/instance.rb:324:in `exec': Failed to execute solr create:  (RuntimeError)
Specified configuration directory solr/conf/ not found!

I appreciate any help to make it work as I have been trying to install for days.

skus...@saintpeters.edu

unread,
Jun 28, 2023, 7:05:30 PM6/28/23
to Blacklight Development
Looking for documentation on bringing an instance of ARCLIGHT into a production environment with SOLR and Passenger over NGINX. 

Any helpful hints or direct instructions would be much appreciated. 

Thanks, 

Sincerely, 
Scott Kushner
Saint Peter's University

Reply all
Reply to author
Forward
0 new messages