Guide to searching.
October 2008
This brief guide will explain a chart that shows a sample of how a MARC21 database can be configured, as well as a brief introductory searching guide. The indexing fields described in this document relate to the bibliographic data and does not address authority database indexing.
Koha uses the Common Command Language (CCL) (ISO 8777) as its internal search protocol. Searches initiated in the graphical interface use this protocol as well, although the searcher doesn't know which indexes, operators and limiters are available and being used to conduct their search. The searcher can use the Advanced Search when more precise results set are desired and where the search indexes are somewhat known. However, some library users and many library staff prefer using a command based structure. This part of the document will present and explain the use of the Koha command based structure. The indexes, operators, and limiters used are identical to those used in the graphical interface.
2.6.1 Indexes
The CCL standard itself doesn't specify a particular set of qualifiers (indexes), but it does suggest a few short-hand notations such as 'ti', 'au', and 'su'. Koha has a default set of indexes; it's possible to customize that set by adding needed indexes based on local requirements. A qualifier (index) maps to a particular use-attribute within the Z39.50 BIB-1 attribute set. The complete Z39.50 Bib-1 Attribute can be viewed at http://www.loc.gov/z3950/agency/defns/bib1.html.
The standard Koha set of indexes is a fairly common example of MARC21 indexing rules. The indexes that are defined in Koha are indexes typically used by other integrated library systems. The defined Z39.50 Bib-1 Attribute mapped to the indexes include:
Table 13.1. Attributes
Bib-1 Attribute | Qualifier (index) |
---|---|
Personal-name | pn |
Corporate-name | cpn |
Conference-name | cfn |
Title | ti |
Title-series | se |
Title-uniform | ut |
ISBN | nb |
ISSN | ns |
Local number | sn |
Local-classification | lcn and callnum |
Subject | su, su-to, su-geo, su-ut |
Pubdate | yr,pubdate |
Date-of-Acquisition | acqdate |
Language | ln |
Place-of-publication | pl |
Abstract | ab |
Notes | nt |
Record-type | rtype, mc-rtype, mus |
Author | au, aut |
Subject-person-name | su-na |
Any (keyword) | kw |
Publisher | pb |
Content-type | ctype |
Koha-Auth-Number | an |
Author-personal-bibliography | aub |
Author-in-order | auo |
Refer to the Koha Indexing Chart for the MARC21 tags mapped to each Bib-1 Attribute and index combination.
2.6.1.1 Audience Examples
-
aud:a Preschool
-
aud:b Primary
-
aud:c Pre-Adolescent
-
aud:d Adolescent
-
aud:e Adult
-
aud:f Specialized
-
aud:g General
-
aud:j Juvenile
2.6.1.2 Contents Examples
-
fic:1 Fiction
-
fic:0 Non Fiction
-
bio:b Biography
-
mus:j Musical recording
-
mus:I Non musical record
2.6.2 Search Syntax
In the persistent search box, single words generally retrieve large sets. To narrow a search, you can use multiple words. Koha automatically uses the 'and' Boolean operator to create a set of records matching your input. When you want to narrow the search to an author or a title or a subject or some other specific field or use a Boolean operator, there isn't an obvious way to accomplish that specificity. The library user can, of course, go to the Advanced Search page; however, if you know how to construct a CCL search, you can achieve more specificity while using the persistent search box on any page.
There is a specific order to the CCL search syntax. Although it can be used for simple searches, it is an especially effective way to perform complex searches, as it affords you a great deal of control over your search results. To construct a CCL search, first enter a desired index code, then an equal sign, followed by your search word(s). Following are examples of simple CCL searches.
-
ti=principles of accounting
-
au=brown joseph
-
su=poetry
-
su-na=Shakespeare
-
kw=marlin
You can refine your search by combining search terms with Boolean operators 'and', 'or', or 'not'. Following are examples of searches using Boolean operators.
-
ti=principles of accounting and au=brown joseph
-
su=poetry not su-na=Shakespeare
-
kw=communication and su=debate
You can also choose to search for things that start with a character or series of characters
-
ti,first-in-subfield=C (will show you all titles that start with the letter 'C')
Other string location searches can be performed with the following keywords:
-
rtrn : right truncation
-
ltrn : left truncation
-
lrtrn : left and right truncation
-
st-date : type date
-
st-numeric : type number (integer)
-
ext : exact search on whole subfield (does not work with icu)
-
phr : search on phrase anywhere in the subfield
-
startswithnt : subfield starts with
Using specific indexes and Boolean operators are not the only way a search can be refined. You can also refine your search as a phrase when looking for a title, author, or subject. The syntax for this search is index,phr=search words.
To illustrate the results of various search types, a search was done for the words 'supreme court'. The results illustrate that the search index and the word order make a difference in search results. Only the results count and the search itself is in these examples. The search executed will always be between the single quotes.









You can also choose to use limiters in your search query. Some common limiters include dates, languages, record types, and item types. In the Advance Search, you can either click a box or key in data to limit your search. You can also apply the same limits with CCL by using the syntax in the following examples. In all
By Date: su=supreme court and yr,st-numeric=>2000

When you limit by date, you can use the '>' (greater than), '<' (less than), '=' (equal), or 'yyyy-yyyy' (range) symbols.
By Item Type: su=nursing and itype:BK

Each library will have a different set of item types defined in their circulation configuration. When you set up item types, you define a code and a name for each one. The name will appear on the Advance Search page. The code you assigned is used as a CCL search limit, formatted as 'itype:x', where 'x' is the assigned code. The initial set of item types in Koha will usually be edited to reflect your collections, so your item type limiters may be different than the initial ones. The initial item type limiters follow.
-
itype:BKS Books, Booklets, Workbooks
-
itype:SR Audio Cassettes, CDs
-
itype:IR Binders
-
itype:CF CD-ROMs, DVD-ROMs, General Online Resources
-
itype:VR DVDs, VHS
-
itype:KT Kit
-
itype:AR Models
-
itype:SER Serials
By format: su=supreme court not l-format:sr

The format limiters are derived from a combination of LDR, 006 and 007 positions. The formats that are currently defined are the following.
-
l-format:ta Regular print
-
l-format:tb Large print
-
l-format:fk Braille
-
l-format:sd CD audio
-
l-format:ss Cassette recording
-
l-format:vf VHS tape
-
l-format:vd DVD video
-
l-format:co CD software
-
l-format:cr Website
By content type: su=supreme court not ctype:l

The content types are taken from the 008 MARC tag, positions 24-27.
There are two other limiter types that are not described in this document. They are: Audience and Content. The only difference in the syntax of the CCL is the actual limiter. They are reproduced here just in case you would like to use these limiters.