Table of Contents

Class: Index Zope-2.2.1-src/lib/python/SearchIndex/Index.py

Index object interface

Base Classes   
Persistent
Methods   
__init__
_apply_index
_reindex
clear
dpHasUniqueValuesFor
dpUniqueValues
index_item
unindex_item
  __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.

  _apply_index 
_apply_index (
        self,
        request,
        cid='',
        )

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.

If the request contains a parameter with the name of the column + _usage, it is sniffed for information on how to handle applying the index.

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.

  _reindex 
_reindex ( self,  start=0 )

Recompute index data for data with ids >= start.

  clear 
clear ( self )

  dpHasUniqueValuesFor 
dpHasUniqueValuesFor ( self,  name )

has unique values for column NAME

  dpUniqueValues 
dpUniqueValues (
        self,
        name=None,
        withLengths=0,
        )

returns the unique values for name

if withLengths is true, returns a sequence of tuples of (value, length)

  index_item 
index_item (
        self,
        i,
        obj=None,
        )

Recompute index data for data with ids >= start.

  unindex_item 
unindex_item (
        self,
        i,
        obj=None,
        )

Recompute index data for data with ids >= start.


Table of Contents

This document was automatically generated on Mon Sep 4 07:33:06 2000 by HappyDoc version r0_6