Lately I’ve been thinking about search bars. We have them on our computers, our phones, and our websites. Library websites have a lot of search bars. How are these little boxes able to deliver results for materials?
So how does a search for library materials work? There’s three main components to a search system: the data, the database or datastore, and the index. These have various functions so let’s look at them individually.
Cataloging is a library activity where trained staff describe the materials owned by the library. These records are fed into the catalog system and are the foundation of the data you search and retrieve materials from. This data comes in different standards and structures to fit different uses and systems.
Databases (or more generally, datastores) are software tools that store the catalog records in a catalog system. There’s various models for how the data is stored and linked internally. The structure of the data going into the datastore puts some constraints on how the it can be organized internally. Most library catalogs use Relation Databases like MySQL.
Searching across the datastore is inefficient. It’s a tool that’s optimized for storage and retrieval. This is where the index comes into play. The index is another software tool, the one sitting just behind that search box you’re inputting your query into. Internally, the index is just creating very large lists of specific record elements from database. Since it’s not working with whole records, it can search much more quickly.
And there you have it: the search box sends your query to the index. The index matches your query to a set of records or data in the database, and the database serves that data back you as the results.