RSS

Tag Archives: cse

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 🙂

http://www.svnlabs.com/demo/cse.php

You have to initiate below JavaScript on event…

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

tabbed.setResultSetSize(GSearch.LARGE_RESULTSET);

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

//searcher.setResultSetSize(GSearch.LARGE_RESULTSET);

searcher.setUserDefinedLabel("svnlabs (pdf)");
searcher.setQueryAddition("filetype:pdf");

//searcher.setResultSetSize(GSearch.LARGE_RESULTSET);

var searcherOptions = new GsearcherOptions();
searcherOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);

tabbed.addSearcher(searcher, searcherOptions);

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

// PHP keyword in search box
tabbed.execute("PHP");

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

http://rcm.amazon.com/e/cm?t=svnlabs09-20&o=1&p=12&l=ur1&category=apparel&f=ifr

 
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

http://www.google.com/cse/

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

}

</script>

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

 
 

Tags: , , , , , ,