Concise Google site Search code

Source: Internet
Author: User

With the increase in the amount of data on the site, the future will be increased to tens of millions of data, the site's own search will increase the use of server resources, in addition to the server set up their own search engine to reduce the site itself database query, I intend to use Google's index as the default site search portal.

My site's own data quality is relatively high, plus the use of good Google Webmaster tools, in the Google Index has been more than 90% of the included number, so the use of Google Index to do site search is still very ideal.

Here will I search in the site of the code changes two, you can use Google to do site search, the following paste a concise code:

<form id= "Search-form" action= "Http://www.google.com/search" method= "Get" >
<input name= "SiteSearch" value= "companylist.biz" type= "hidden" >
<input id= "s" type= "text" name= "Q" placeholder= "Search &hellip;" style= "Display:none" >
<input id= "Search-submit" type= "Submit" name= "s" value= "search" >

You can change any of these, and you can add more attributes:

Parameter reference:
Name= "SiteSearch": Tell Google the specific site or domain name you want to search for
Name= "ie": tells Google to send the search terms of the page code, the default is "Utf-8″, because in China many sites are using GB2312 encoding
name = "OE": tells Google to display the search page encoding, the default value is "Utf-8″, because most modern machines can support" Utf-8″ correct, so you probably do not need to adjust the secondary parameters;
name = "HL": tells Google to display the search page language. "ZH-CN" for Simplified Chinese, "zh-tw" for Traditional Chinese, "en" for English.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.