Cheshire3 Object Model - IndexStore¶
- class cheshire3.baseObjects.IndexStore(session, config, parent=None)¶
A persistent storage mechanism for terms organized by Indexes.
Not an ObjectStore, just looks after Indexes and their terms.
- begin_indexing(session, index)¶
Prepare to index Records.
Perform tasks as required before indexing begins, for example creating batch files.
- clean_index(session, index)¶
Remove all the terms from an Index, but keep the specification.
- commit_centralIndexing(session, index, filePath)¶
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)¶
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)¶
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)¶
Does the IndexStore currently store the given Index.
- create_index(session, index)¶
Create an index in the store.
- create_term(session, index, termId, resultSet)¶
Take resultset and munge to Index format, serialise, store.
- delete_index(session, index)¶
Completely delete an index from the store.
- delete_terms(session, index, terms, rec=None)¶
Delete the given terms from Index.
Optionally only delete terms for a particular Record.
- fetch_proxVector(session, index, rec, elemId=-1)¶
Fetch and return a proximity vector for the given Record.
- fetch_sortValue(session, index, item)¶
Fetch a stored value for the given Record to use for sorting.
- fetch_summary(session, index)¶
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)¶
Fetch and return data for a single term.
- fetch_termById(session, index, termId)¶
Fetch and return data for a single term based on term identifier.
- fetch_termFrequencies(session, index, mType, start, nTerms, direction)¶
Fetch and return a list of term frequency tuples.
- fetch_termList(session, index, term, nTerms=0, relation='', end='', summary=0, reverse=0)¶
Fetch and return a list of terms for an Index.
- 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)¶
Fetch and return a vector for the given Record.
- store_terms(session, index, terms, rec)¶
Store terms in the index for a given Record.