Adding new searchable fields

From DLXS Documentation

(Difference between revisions)
Jump to: navigation, search
Current revision (19:41, 14 September 2007) (edit) (undo)
 
(2 intermediate revisions not shown.)
Line 1: Line 1:
-
= Overview =
 
-
A basic set of fields has been declared in the [[bib.map]] file and these can be used along with [[Working with the Collection Manager|collmgr]] to enable or turn on searches for those fields. The basic fields currently include:
 
- 
-
* <tt>author</tt>
 
-
* <tt>title</tt>
 
-
* <tt>entire record</tt>
 
-
* <tt>publisher</tt>
 
-
* <tt>place of publication</tt>
 
-
* <tt>year</tt> (i.e., date of publication)
 
-
* <tt>series</tt>
 
-
* <tt>notes</tt>
 
-
* <tt>collection</tt> (i.e., collection ID)
 
-
* <tt>format</tt> (e.g., HTML)
 
-
* <tt>type</tt> (e.g., text)
 
-
* <tt>language</tt>
 
-
* <tt>id</tt> (i.e., the ID of the record)
 
-
* <tt>dt</tt> (i.e., the OAI-specified date of last update for a record)
 
- 
-
and all are based on encoding that conforms to the [dtd.html <tt>bib.dtd</tt>].
 
- 
-
It may be necessary to define additional fields or to substitute values (based on different encoding practices) for the values used in this <tt>bib.map</tt>. 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 <tt>bib.map</tt>, a new map file should be created for each collection. The file <tt>bib.map</tt> and the new map file you will create are (or will be) located in the <tt>/{DLXSROOT}/misc/b/bib/maps</tt> 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 [../../collmeta/maps.html a generic overview of map files].
 
- 
-
Each mapping element in a map file consists of the following:
 
- 
-
; <tt>label</tt>
 
-
: 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 ([#collmgr see below]).
 
-
; <tt>synthetic</tt>
 
-
: This element determines the variable name that is used in the cgi.
 
-
; <tt>native</tt>
 
-
: 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., <tt>region YR</tt>) or complex (e.g., <tt>(region origin within region citation) + (region publish within region citation)</tt>)
 
-
; <tt>nativeregionname</tt>
 
-
: This element is not used by BibClass and so content within the element may be omitted.
 
-
; <tt>summarylabel</tt>
 
-
: 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 <tt>patent.map</tt> with any standard text editor and copy the contents of <tt>bib.map</tt> 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 <tt>&lt;!-- operator mapping --&gt;</tt>. An example of an operator mapping is as follows:
 
- 
-
 
-
&lt;mapping&gt;
 
-
&lt;label&gt;And&lt;/label&gt;
 
-
&lt;synthetic&gt;AND&lt;/synthetic&gt;
 
-
&lt;native&gt;^&lt;/native&gt;
 
-
&lt;/mapping&gt;
 
- 
-
Operator mappings use the synthetic element in BibClass; 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, <tt>patent</tt>, consists of records without authors; in this case, we would remove the region mapping for author that looks like this:
 
- 
-
 
-
&lt;mapping&gt;
 
-
&lt;label&gt;author&lt;/label&gt;
 
-
&lt;synthetic&gt;&lt;/synthetic&gt;
 
-
&lt;native&gt;region L&lt;/native&gt;
 
-
&lt;nativeregionname&gt;&lt;/nativeregionname&gt;
 
-
&lt;summarylabel&gt;au&lt;/summarylabel&gt;
 
-
&lt;/mapping&gt;
 
- 
-
Next, add new mappings for the fields that you would like to make searchable in the interface. (Remember, each BibClass record will typically be searchable across ''all'' fields by using the mapping <tt>entire record</tt>, which is mapped to <tt>region A</tt>.) 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 BibClass, and (3) a new element based on the combination of two complex searches:
 
- 
-
#
 
-
&lt;mapping&gt;
 
-
&lt;label&gt;patent number&lt;/label&gt;
 
-
&lt;synthetic&gt;&lt;/synthetic&gt;
 
-
&lt;native&gt;region PATNO&lt;/native&gt;
 
-
&lt;nativeregionname&gt;&lt;/nativeregionname&gt;
 
-
&lt;summarylabel&gt;patent #&lt;/summarylabel&gt;
 
-
&lt;/mapping&gt;
 
-
#
 
-
&lt;mapping&gt;
 
-
&lt;label&gt;year&lt;/label&gt;
 
-
&lt;synthetic&gt;&lt;/synthetic&gt;
 
-
&lt;native&gt;region YR within region citation&lt;/native&gt;
 
-
&lt;nativeregionname&gt;&lt;/nativeregionname&gt;
 
-
&lt;summarylabel&gt;year&lt;/summarylabel&gt;
 
-
&lt;/mapping&gt;
 
-
#
 
-
&lt;mapping&gt;
 
-
&lt;label&gt;data type&lt;/label&gt;
 
-
&lt;synthetic&gt;&lt;/synthetic&gt;
 
-
&lt;native&gt;(region geoform within region citation) + (region formname)&lt;/native&gt;
 
-
&lt;nativeregionname&gt;&lt;/nativeregionname&gt;
 
-
&lt;summarylabel&gt;data type&lt;/summarylabel&gt;
 
-
&lt;/mapping&gt;
 
- 
-
= 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 [../../collmeta/collmgr.html collmgr]'s <tt>map</tt> field, declare your map file (e.g., <tt>patent.map</tt>). Next, in collmgr's <tt>regionsearch</tt> field, add your searchable fields. These must correspond to the <tt>label</tt> 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.
 

Current revision

Personal tools