Chapter 9 Search module API

The search module API allows for processing of a search term on, and handles the display of relevant search results. Modules are typically related to a particular data type (i.e. a table in the audioblast database), although there are more abstract modules that solely process search terms in order to allow them to be processed by other modules.

9.1 Search API class

9.1.1 init()

9.1.2 displayPrototype()

Create a region on the results page for displaying search results.

9.1.3 parse()

Parses the search term for relevant terms, and may modify terms.

9.1.4 display()

Handles the display of search results to the user.

9.1.5 searchSuggests()

Provides a short list of indicative search terms that may be handled by the module. This is used to suggest search terms on the homepage.

9.2 Current search modules

9.2.1 Pythia

Pythia uses an audioBlast API to match words in the search term to tokens using direct access to the audioBlast database.

9.2.2 Linnaeus: taxonomic name information and processing

The parse() function in Linnaeus takes a taxon name token identified by Pythia and converts it to a taxon name with rank token.

Linnaeus also handles the taxon info box, that provides search navigation through parent taxa.

9.2.3 King Solomon’s Ring

King Solomon’s Ring converts everyday terms relating to animal behavior into named trait with value tokens (e.g. silent to sound production method being equal to None.)

9.2.4 Rosetta

Rosetta handles the conversion of emoji in search terms to taxonomic names using the Phymoji package.