Last updated 2003-03-04 09:39:16 EST
Doc Title Adding New Searchable Fields, Bibliographic Class
Author 1 Hagedorn, Kat
CVS Revision $Revision: 1.6 $
Adding New Searchable Fields, Bibliographic Class

Overview

A basic set of fields has been declared in the file bib.map and these can be used along with collmgr to enable or turn on searches for those fields. The basic fields currently include:

and all are based on encoding that conforms to the bib.dtd.

It may be necessary to define additional fields or to substitute values (based on different encoding practices) for the values used in this bib.map. This section outlines the steps necessary to create a new map file, and the steps in the collmgr needed to take advantage of these new (i.e., additional or different) fields.

Creating and Modifying the map File

Rather than modifying the file bib.map, a new map file should be created for each collection. The file bib.map and the new map file you will create are (or will be) located in the /{DLXSROOT}/misc directory. For the purposes of this documentation, we will use the example "patent.map" for a hypothetical collection with the collection ID "patent". For more information, go to a generic overview of map files.

Each mapping element in a map file consists of the following:

label
This element determines what will display in the user's browser when constructing searches, and is case sensitive. It must match the value used in the collmgr (see below).
synthetic
This element determines the variable name that is used in the cgi.
native
The "native" element provides an appropriate XPAT search that the system will use to discover the appropriate content. The search may be simple (e.g., region YR) or complex (e.g., (region origin within region citation) + (region publish within region citation))
nativeregionname
This element is not used by Bibliographic Class and so content within the element may be omitted.
summarylabel
This element determines what will display in the user's browser when reporting the search and corresponding results, and is frequently used to declare an abbreviation such as "date" for "date of publication".

Create the file patent.map with any standard text editor and copy the contents of bib.map to it. Each map file consists of a section of "operator" mappings (e.g., ), followed by a section of "region" mappings; each section is introduced by a comment such as <!-- operator mapping -->. An example of an operator mapping is as follows:

 <mapping> <label>And</label> <synthetic>AND</synthetic> <native>^</native> </mapping> 

Operator mappings use the synthetic element in Bibliographic Class; region mappings do not.

Begin by removing all mapping groups that are not relevant to your collection. For example, let us say that our example collection, patent, consists of records without authors; in this case, we would remove the region mapping for author that looks like this:

 <mapping> <label>author</label> <synthetic></synthetic> <native>region
L</native> <nativeregionname></nativeregionname> <summarylabel>au</summarylabel> </mapping> 

Next, add new mappings for the fields that you would like to make searchable in the interface. (Remember, each Bibliographic Class record will typically be searchable across all fields by using the mapping entire record, which is mapped to region A.) In the following three examples, we declare (1) a new, simple field based on a single element, (2) a re-mapping of an element already declared for Bibliographic Class, and (3) a new element based on the combination of two complex searches:

  1.  <mapping> <label>patent number</label> <synthetic></synthetic> <native>region
          PATNO</native> <nativeregionname></nativeregionname> <summarylabel>patent
          #</summarylabel> </mapping> 
  2.  <mapping> <label>year</label> <synthetic></synthetic> <native>region
          YR within region citation</native> <nativeregionname></nativeregionname> <summarylabel>year</summarylabel> </mapping> 
  3.  <mapping> <label>data type</label> <synthetic></synthetic> <native>(region
          geoform within region citation) + (region formname)</native> <nativeregionname></nativeregionname> <summarylabel>data
          type</summarylabel> </mapping> 

collmgr Steps Needed to Support Additional Searchable Fields

You will need to have the colldb database point to your new map file, and to declare the new searchable fields for the user interface. First, in collmgr's map field, declare your map file (e.g., patent.map). Next, in collmgr's regionsearch field, add your searchable fields. These must correspond to the label elements in the mapping, described above.

You may also need to support searchable fields such as date of publication (e.g., for sorting) or ID (for record-oriented operations like using the bookbag), but not need to show these as being searchable in the user interface. In these cases, you should create mappings, but not declare the regions in collmgr.