Cheshire3 Objects: Index

Description

An Index is an object which defines an access point into records and is responsable for extracting that information from them. It can then store the information extracted in an IndexStore. The entry point can be defined using one or more XPath expressions, and the extraction process can be defined using a workflow chain of standard objects. These chains must start with an Extracter, but from there might then include PreParsers, Parsers, Transformers, Normalisers and even other Indexes.

A simple chain for a stemmed keyword index might be:

Whereas a chain which takes a URL from an attribute, fetches it and then extract s title keywords from it might look like:

Implementations
API

FunctionParametersReturnsDescription
__init__domNode, parentObject The constructer takes a DOM tree containing the configuration of the index and the object which the database should consider as its parent, normally a database.
indexRecordsession, record Index a record according to this index's rules
removeRecordsession, record Remove the terms of a record from our index
updateRecordsession, newRecord, oldRecord Remove the terms from the old record and add the new
searchsession, searchClause, databaseresultSetProcess search query against self and return resultSet
scansession, searchClause, numberOfTerms, directionlist of term informationHandle a scan/browse request
sortsession, resultSetsresultSetSort resultsets according to the extraction rules of this index.
begin_indexingsession Set up for batch mode indexing (many records will be indexed, optimize and save data on commit)
commit_indexingsession Save batch mode indexing