Blacklight Plugin

Problem with forcing per_page param in URL

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.1
  • Fix Version/s: 2.1
  • Component/s: None
  • Description:
    Hide
    If you manually enter a large number in to the per_page parameter in the URL, you can run into a big problem.

    We have a 5 million + index, and I did an Everything Search with a blank query and asked for 100 results per page. I then manually put in 5000000 as the per_page param and the server just hung.

    We had to restart solr to get the index back.

    I'm proposing the following change the solr_helper.rb -line17
    - :per_page => args[:per_page],
    + :per_page => args[:per_page].to_i > 100 ? "100" : args[:per_page],

    I think this is the proper way to go about it, and of course a test should accompany it.
    Show
    If you manually enter a large number in to the per_page parameter in the URL, you can run into a big problem. We have a 5 million + index, and I did an Everything Search with a blank query and asked for 100 results per page. I then manually put in 5000000 as the per_page param and the server just hung. We had to restart solr to get the index back. I'm proposing the following change the solr_helper.rb -line17 - :per_page => args[:per_page], + :per_page => args[:per_page].to_i > 100 ? "100" : args[:per_page], I think this is the proper way to go about it, and of course a test should accompany it.

Activity

Hide
Jessie Keck added a comment - 22/Apr/09 7:59 PM
The fix for this is now in place along with a test written to ensure that a maximum of 100 rows is passed to solr from the per_page param.
Show
Jessie Keck added a comment - 22/Apr/09 7:59 PM The fix for this is now in place along with a test written to ensure that a maximum of 100 rows is passed to solr from the per_page param.

People

Dates

  • Created:
    21/Apr/09 6:01 PM
    Updated:
    22/Apr/09 7:59 PM
    Resolved:
    22/Apr/09 7:59 PM