You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is a Ruby API to Google’s Custom Search Engine (www.google.com/cse).
If you want a Google-like search engine for your web site, why not use Google? For $100/yr (more if you have over 1,000 pages) you can get access to Google search results for your site in XML format. The google_custom_search gem helps you access this web service and publish the results on your site however you like (all covered under Google’s acceptable use policy).
Google Custom Search is currently compatible with Rails 2.x and Rails 3.
You must define a constant in your application called GOOGLE_SEARCH_CX. For example, if you’re using Rails, create a file config/initializers/google_custom_search.rb:
GOOGLE_SEARCH_CX = "..."
You can find the CX value for your custom search engine via the search control panel on Google’s site (click the “Get code” link and you’ll see a hidden “cx” field in the sample HTML form).
Optionally, you can set default Google search params, such as encoding, by setting up the GOOGLE_SEARCH_PARAMS hash in the same initializer: