You are here

Creating a Search Box for the CUNY Catalog

Some library websites present a search box that allows for a simple keyword search in the library's catalog. This is also possible with Aleph's web OPAC. Before using this, you should read the document "How to link to an ALEPH Catalog," available at the bottom of this page. (You must login to access it.)

Please use this form with a proxy server
You are encouraged to direct users to the catalog through a proxy server. To do this, you will need to pre-proxy the URL, i.e., use its "rewritten" form.

For the CUNY Central proxy server, you would use:
http://libsearch.cuny.edu.central.ezproxy.cuny.edu:2048/F/

instead of:
http://central.ezproxy.cuny.edu:2048/login?url=http://libsearch.cuny.edu/F/

within the <form> tags.

Basic Keyword Search Box

A very simple search box would search all fields for the keyword(s) entered by the user.

Keyword(s):    

Markup for this example

<form action="http://libsearch.cuny.edu.central.ezproxy.cuny.edu:2048/F/" method="get">
<input type="hidden" name="func" value="find-e" />
Keyword(s): 
<input type="text" name="request" /> 
<input type="hidden" name="find_scan_code" value="find_wrd" />
<input type="hidden" name="adjacent" value="N" />
<input type="submit" value="Search" /> 
<input type="reset" />
</form>

Basic Search Box with Options

A more sophisticated form would allow for the selection of the index to be searched (e.g., title, author, subject, or anywhere in the record) and would give the possibility to select adjacency ("phrase" search), just like the basic search page of the CUNY Catalog:

Keyword(s):  Search in:  Phrase?:  

Markup for this example

<form action="http://libsearch.cuny.edu.central.ezproxy.cuny.edu:2048/F/" method="get">
<input type="hidden" name="func" value="find-e" />
Keyword(s):
<input type="text" name="request" />
Search in:
<select name="find_scan_code"> 
	<option value="FIND_WRD" selected="selected">All Fields</option> 
	<option value="SCAN_TTL">Title begins with...</option> 
	<option value="SCAN_AUT">Author, last name first...</option> 
	<option value="SCAN_SUL">Subject begins with...</option> 
	<option value="FIND_WTI">Keyword in title</option> 
	<option value="FIND_WAU">Keyword in author</option> 
	<option value="FIND_WSU">Keyword in subject</option> 
	<option value="SCAN_SUC">Children's subject begins with...</option> 
	<option value="SCAN_SUM">MeSH subject begins with...</option> 
	<option value="SCAN_SHL">Call number</option> 
	<option value="SCAN_ISBN">Browse ISBN</option> 
	<option value="SCAN_ISSN">Browse ISSN</option> 
</select>
Phrase?:
<select name="adjacent">
	<option selected="selected" value="N">No</option>
	<option value="Y">Yes</option>
</select>
<input type="submit" value="Search" />
</form>

You can remove any of the search options (those in <select name="find_scan_code"> tags) that you do not wish to offer to your users from your library's website.

You can also remove the option for adjacency. (Placing quotes around a "search term" will do the same thing.) To do that, replace the <select name="adjacent">...</select> section with:
<input type="hidden" name="adjacent" value="N" />

Search vs Browse

In the search box above, you will notice "[Field] begins with..." and "Keyword in [field]." The distinction is an important one. Those options beginning with: find_ will do a search in that field (e.g., find_wti performs a search in the title index, producing results where the search term appears somewhere in the title) while those beginning with scan_ will present users with a list of results to browse (e.g., scan_ttl will produce a browsable list of links in the catalog where the titles begin with the search term).

find_wti
scan_ttl

Not seeing link to download "How to Link to the Aleph Catalog" file here? Please login!