Cheshire3 Object Model - IndexStore

API

class cheshire3.baseObjects.IndexStore(session, config, parent=None)[source]

A persistent storage mechanism for terms organized by Indexes.

Not an ObjectStore, just looks after Indexes and their terms.

begin_indexing(session, index)[source]

Prepare to index Records.

Perform tasks as required before indexing begins, for example creating batch files.

clean_index(session, index)[source]

Remove all the terms from an Index, but keep the specification.

commit_centralIndexing(session, index, filePath)[source]

Finalize indexing for given index in single process context.

Commit data from the indexing process to persistent storage. Called automatically unless indexing is being carried out in distributed context. In this case, must be called in only one of the processes.

commit_indexing(session, index)[source]

Finalize indexing for the given Index.

Perform tasks after all Records have been sent to given Index. For example, commit any temporary data to disk.

construct_resultSetItem(session, recId, recStoreId, nOccs, rsiType=None)[source]

Create and return a ResultSetItem.

Take the internal representation of a term, as stored in this Index, create and return a ResultSetItem from it.

contains_index(session, index)[source]

Does the IndexStore currently store the given Index.

create_index(session, index)[source]

Create an index in the store.

create_term(session, index, termId, resultSet)[source]

Take resultset and munge to Index format, serialise, store.

delete_index(session, index)[source]

Completely delete an index from the store.

delete_terms(session, index, terms, rec=None)[source]

Delete the given terms from Index.

Optionally only delete terms for a particular Record.

fetch_proxVector(session, index, rec, elemId=-1)[source]

Fetch and return a proximity vector for the given Record.

fetch_sortValue(session, index, item)[source]

Fetch a stored value for the given Record to use for sorting.

fetch_summary(session, index)[source]

Fetch and return summary data for all terms in the Index.

e.g. for sorting, then iterating. USE WITH CAUTION! Everything done here for speed.

fetch_term(session, index, term, summary=0, prox=0)[source]

Fetch and return data for a single term.

fetch_termById(session, index, termId)[source]

Fetch and return data for a single term based on term identifier.

fetch_termFrequencies(session, index, mType, start, nTerms, direction)[source]

Fetch and return a list of term frequency tuples.

fetch_termList(session, index, term, nTerms=0, relation='', end='', summary=0, reverse=0)[source]

Fetch and return a list of terms for an Index.

Parameters:
  • numReq (integer) – how many terms are wanted.
  • relation – which order to scan through the index.
  • end – a point to end at (e.g. between A and B)
  • summary – only return frequency info, not the pointers to

matching records. :type summary: boolean (or something that can be evaluated as True or False) :param reverse: use the reversed index if available (eg ‘xedni’ not ‘index’). :rtype: list

fetch_vector(session, index, rec, summary=0)[source]

Fetch and return a vector for the given Record.

store_terms(session, index, terms, rec)[source]

Store terms in the index for a given Record.

Implementations

The following implementations are included in the distribution by default:

class cheshire3.indexStore.BdbIndexStore(session, config, parent)[source]

In addition to the default implementation, the cheshire3.sql provides the following implementations: