In the Quick Start (Section 2.1) we have seen the function make_catalog, which creates a new catalog in the file system.
We also need to see how to load a catalog that already exists, that was created some time before. This is done using directly the class Catalog:
>>> from itools.catalog import Catalog
>>>
>>> catalog = Catalog('catalog_test')
This call expects the file system path where the catalog was created.
Just to summarize these are the ways to build and to load, respectively, a catalog object:
make_catalog(path)
Creates a new and empty catalog at the given path. Returns a catalog object (instance of the Catalog class).
Catalog(path)
Loads the catalog at the given path.
The fields to be indexed are defined by the indexed objects. This we will see in the next section.