Tag Archives: Custom Google Search

Custom Google Search – setQueryAddition

Google Custom Search service provide customized search for web on your site or blog.
We can filter Google Custom Search results on filetype like PDF 🙂

You have to initiate below JavaScript on event…

// create a tabbed mode search control
var tabbed = new GSearchControl();


// add an additional term to the query
// in this case filetype:pdf
var searcher = new GwebSearch();


searcher.setUserDefinedLabel("svnlabs (pdf)");


var searcherOptions = new GsearcherOptions();

tabbed.addSearcher(searcher, searcherOptions);

// draw in tabbed layout mode
var drawOptions = new GdrawOptions();
tabbed.draw(document.getElementById("search_control_tabbed"), drawOptions);

// PHP keyword in search box

Every day do one thing that you think you cannot do. Soon you will realize that there is nothing that you can not do…

Leave a comment

Posted by on January 31, 2011 in Imagine, javascript, Open Source, php, Tips, Tricks


Tags: , , , , , , , , , , , , , ,

Custom Google Search

Google Custom Search service provide customized search for web on your site or blog.

1. We can add site’s links to get fast and relevant search results
2. We can make money with AdSense for Search
3. We can invite friends and community to contribute
4. We can include one or more websites, or specific webpages
5. We can host the search box and results on your own website
6. We can customize the look and feel of the results to match your site

We can make topic / site specific search on google see below

Magento Search Engine

We can integrate custom google search with our site search, we have to add below to our site…

<script type=”text/javascript”>

window.onload = function()

jQuery(“.gsc-input”).focus();  // google search input box

jQuery(“.gsc-input”).val(‘<?php echo isset($_REQUEST[‘q’])?$_REQUEST[‘q’]:”; ?>’); // auto fill site’s search keyword to custome search

jQuery(“.gsc-search-button”).click(); // trigger submit event



Waves are my inspiration, not because they rise and fall, but each time they fall They Rise Again… 🙂


Tags: , , , , , ,