Methods
|
|
|
|
__getitem__
|
__getitem__ ( self, word )
Return an InvertedIndex-style result "list"
|
|
__init__
|
__init__ (
self,
data=None,
schema=None,
id=None,
ignore_ex=None,
call_methods=None,
)
Create an index
The arguments are:
-
data a mapping from integer object ids to objects or
records,
-
schema a mapping from item name to index into data
records. If data is a mapping to objects, then schema
should ne None .
-
id the name of the item attribute to index. This is
either an attribute name or a record key.
-
ignore_ex Tells the indexer to ignore exceptions that
are rasied when indexing an object.
-
call_methods Tells the indexer to call methods instead
of getattr or getitem to get an attribute.
|
|
_apply_index
|
_apply_index (
self,
request,
cid='',
ListType=[],
)
Apply the index to query parameters given in the argument,
request
The argument should be a mapping object.
If the request does not contain the needed parameters, then
None is returned.
Otherwise two objects are returned. The first object is a
ResultSet containing the record numbers of the matching
records. The second object is a tuple containing the names of
all data fields used.
|
|
_index_document
|
_index_document (
self,
document_text,
id,
un=0,
tupleType=type(() ),
dictType=type({} ),
)
|
|
_reindex
|
_reindex ( self, start=0 )
Recompute index data for data with ids >= start.
|
|
_subindex
|
_subindex (
self,
isrc,
d,
old,
last,
)
|
|
clear
|
clear ( self )
|
|
index_item
|
index_item (
self,
i,
obj=None,
un=0,
)
Recompute index data for data with ids >= start.
if obj is passed in, it is indexed instead of _data[i]
|
|
positions
|
positions (
self,
docid,
words,
)
Return the positions in the document for the given document
id of the word, word.
|
|
unindex_item
|
unindex_item (
self,
i,
obj=None,
)
|
|