Table of Contents

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

UnIndex object interface

Base Classes   
Persistent
Implicit
Methods   
__init__
__len__
_apply_index
clear
hasUniqueValuesFor
index_object
unindex_object
uniqueValues
  __init__ 
__init__ (
        self,
        id=None,
        ignore_ex=None,
        call_methods=None,
        )

Create an unindex

UnIndexes are indexes that contain two index components, the forward index (like plain index objects) and an inverted index. The inverted index is so that objects can be unindexed even when the old value of the object is not known.

The arguments are:

id

the name of the item attribute to index. This is either an attribute name or a record key.

ignore_ex

should be set to true if you want the index to ignore exceptions raised while indexing instead of propagating them.

call_methods

should be set to true if you want the index to call the attribute id (note: id should be callable!) You will also need to pass in an object in the index and uninded methods for this to work.

  __len__ 
__len__ ( self )

  _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.

  clear 
clear ( self )

  hasUniqueValuesFor 
hasUniqueValuesFor ( self,  name )

has unique values for column NAME

  index_object 
index_object (
        self,
        i,
        obj,
        threshold=None,
        )

index and object obj with integer id i

  unindex_object 
unindex_object ( self,  i )

Unindex the object with integer id i and don't raise an exception if we fail

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

returns the unique values for name

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


Table of Contents

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