Adding Text Class Search Functionality

From DLXS Documentation

Jump to: navigation, search

Main Page > Mounting Collections: Class-specific Steps > Mounting a Text Class Collection > Adding Text Class Search Functionality

[edit] Overview

Depending upon the markup and metadata available in your collection, you might want to add to the basic search functionality in Text Class. The most basic additional functionality is the ability to restrict the search to a particular date range, as seen in the Making of America. Other restrictions natively supported include genre and period restrictions, as seen in the English Poetry Database, and gender restrictions, as seen in the American Poetry Database.

[edit] Restricting by Date of Publication

First, you need to determine the range of dates available in your collection. This is generally found in the maindate region. Look at the dates and determine what the range is, and how wide the range is. Is it a collection where most things are published within a small span, or one that covers several decades or even centuries? This information will be necessary when you set up your search restriction.

Once you've assessed the publication dates in your collection, you will need to modify the collmgr entry for the collection and the map used by the collection. In the collmgr, you will need to fill in the year for the beginning of the range of dates the item was first published, the year for the end of the range of dates the item was first published, and the increment you want to have between years. If the range is relatively small, choose 1, and every year between the first year and last year in the range will show up in the pulldown menus. If it is large, covering centuries, you may wish to set the increment to 10, and adapt the publication start and end dates to neatly cover the range. (Since it is searching a span, a collection that has an earliest publication date of 1828 and a latest publication date of 2009 can be said to cover 1820 to 2010 without incurring search errors.) The Making of America journals, which have a limited range of publication dates, have these collmgr settings:

firstpublishedend : 1902
firstpublishedinc : 2
firstpublishedstart : 1830

Because the date range is relatively restricted, the increment here is two years. That is, in the pulldown, the user sees 1830, 1832, 1834, 1836, etc. Searching can be restricted to a single year (both pulldowns contain the same year), a two-year span (for example, 1860-1862), a four-year span (for example, 1860-1864), or the default search on the entire period.
Although items without publication dates show up in the default search of the whole collection, they WILL NOT turn up in a search restricted by date range. Sooty

Then you will need to check your collections map file to make sure that this functionality is supported. You will need the following mappings in place:

 <mapping>
   <label>published</label>
   <synthetic>FIRST_PUBL</synthetic>
   <native>(region DATE within region SOURCEDESC)</native>
   <nativeregionname>DATE</nativeregionname>
 </mapping>
 <mapping>
   <label>date</label>
   <synthetic>DATE</synthetic>
   <native>region maindate</native>
   <nativeregionname>maindate</nativeregionname>
 </mapping>
 <mapping>
   <label>published item</label>
   <synthetic>DATESEARCH</synthetic>
   <native>region main</native>
   <nativeregionname>main</nativeregionname>
 </mapping>
Personal tools