Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Created August 5, 2010 11:29
Show Gist options
  • Save omarqureshi/509594 to your computer and use it in GitHub Desktop.
Save omarqureshi/509594 to your computer and use it in GitHub Desktop.
Index: app/controllers/mgm/search_controller.rb
===================================================================
--- app/controllers/mgm/search_controller.rb (revision 18393)
+++ app/controllers/mgm/search_controller.rb (working copy)
@@ -57,9 +57,8 @@
def perform_google_search(opts)
google_search = GoogleSearch.new(opts, @shop_id, "mgm_frontend", params[:page] || 1,
- session[:session_id])
+ session[:session_id], PER_PAGE)
google_search.exclude_fields = [:product_id, :series_id, :content_id, :shop_id]
- google_search.per_page = PER_PAGE
google_search.send_and_parse
@number_of_results = google_search.number_of_results
@results = google_search.results
Index: lib/google_search.rb
===================================================================
--- lib/google_search.rb (revision 18393)
+++ lib/google_search.rb (working copy)
@@ -9,10 +9,10 @@
attr_reader :results, :taxon_ids_and_counts
attr_writer :number_results_to_parse, :exclude_fields, :site, :per_page
- def initialize(options, shop_id, client="default_frontend", page=1, session_id=nil)
+ def initialize(options, shop_id, client="default_frontend", page=1, session_id=nil, per_page=10)
@shop_id = shop_id
@session_id = session_id
- @per_page = 10
+ @per_page = per_page
@options = options
@client = client
@site = 'default_collection'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment