Main PagePolicies & GuidelinesWeb Admin FunctionsAssistance & ServicesFAQContact

Search Function

Google Custom Search provides web page indexing and searching service to CUHK websites. In addition to searching the entire CUHK website (as seen on CUHK front page), departments can implement their own search button to let visitors search for information within the department.

Implementing Departmental Search Button

By providing a Departmental Search Button on your web site, your visitors can perform a search within your site.

Depending on the space available on your web page, the following 3 formats are suggested. You may view the HTML source code of the search forms and copy it to your web page. (Note that the following 3 samples only search ITSC web site.)

Search Powered by Google
View HTML Source
View HTML Source
View HTML Source

You need to customize certain hidden fields in the search form. The fields domain and inurl can be used to limit the search to your department's URLs only. For example, ITSC web pages start with, the corresponding hidden fields should be used to limit the search to ITSC pages:

<input type="hidden" name="domain" value="">
<input type="hidden" name="inurl" value="itsc">

If your department has your own domain name, you can simply specify the domain to include the servers in this domain:

<input type="hidden" name="domain" value="">
<input type="hidden" name="inurl" value="">

Multiple domains should be separated with commas. For example, to search in the Engineering Faculty:

<input type="hidden" name="domain" value=",,,,,">
<input type="hidden" name="inurl" value="">

You can also limit the search to a part of your web site. For example, the CSE staff list is under the URL So you can use the following to search within that list. Note that the URLs of the search results will contain all the keywords in the filed 'inurl'.

<input type="hidden" name="domain" value="">
<input type="hidden" name="inurl" value="v5,people">

Here're the list of all the relevant fields:

Field Description Acceptable values
domain Limit the search to certain domain(s) Comma separated list of domain names end with ''
inurl Only include URLs that contain certain keywords Comma separated list of keywords (i.e. department codes)
enc Content encoding method of the search form. Should equal to the 'charset' declared in the page containing the search form. 'big5', 'gb2312', 'utf-8'


  1. Is there any charge in using the Google Custom Search service?

    There is no charge for CUHK departments and units.

  2. Can I remove the Google logo from the search form?

    There are two purposes of including the Google logo: 1) to acknowledge Google providing this service; 2) to make known to visitors that Google is providing this service (in case there is any problem, user will know who to seek help from)

  3. How to increase the rank of my web site?

    There are a lot of discussions on the Internet. We tried to summarize below the ways we found effective (not only for Google, but also for other search engines):
    • Identify the keywords in your page
    • Use not more than 10 keywords in a page (otherwise most search engines will consider there is a keyword spamming)
    • Put the keywords in the <TITLE> tag
    • Use the keywords in the directory path, i.e. organize your site hierarchically with sensibly named folders
    • If your site is referenced by many other sites, your rank will be higher. But do not try to create the references artificially. Search engines will detect such pattern and lower your rank

  4. How to exclude the search robot?

    Google Search obeys the robot exclusion standard. If you do not want Google to index all or part of your web site, prepare a robots.txt file at your root directory. Check here for details of the syntax of robots.txt.

  5. Why some pages are not indexed?

    There are many reasons that a page could not be indexed, followings are some typical reasons:
    • No direct/indirect link from CUHK front page (
    • Macromedia Flash only main page
    • Password protected pages
    • Pages restricted to certain IP addresses (e.g. 137.189.)
    • Text within images, multimedia files : if you choose to include these files, be sure to give them descriptive names, provide detailed alternative text, and (if possible) provide alternative forms of the same information.
    • Extremely long text files
    • Parent page uses only JavaScipt to link to this page

  6. Can protected sites be searched?

    No, since the Google crawler (the search robot that visits and indexes our web pages) operates outside CUHK, your web site will 'see' this crawler as an anonymous visitor from an IP address outside of 137.189. So password protected or IP restricted web pages could not be indexed.

Back to top of page

Back to Assistance and Services Page