[Zope] Odd behaviour with lexicons and ZCTextIndex

Paavo Parkkinen pparkkin@verso.st.jyu.fi
Wed, 9 Jul 2003 13:56:59 +0300


We have a site with the following structure:

/
`- foo
   |- lexicon
   `- bar

(foo and bar are ZClasses)

When I add the 'bar' under 'foo', and in 'bar's constructor, add a
catalog to bar and a ZCTextIndex to the catalog with an external
method[1], in 2.6.0 it works just fine, but with 2.6.1 I get the
following error:

Error Type: LookupError
Error Value: Lexicon "lexicon" not found

The end of the traceback looks like this:

    *  Module Products.ZCatalog.ZCatalog, line 897, in addIndex
    *  Module Products.ZCTextIndex.ZCTextIndex, line 78, in __init__

LookupError: Lexicon "lexicon" not found

[1] the external method we use for adding ZCTextIndexes:

def addZCTextIndex(context, id, field=3D''):
        extra =3D Extra()
        extra.index_type =3D 'Okapi BM25 Rank'
        extra.lexicon_id =3D 'lexicon'
        if field:
                extra.doc_attr =3D field

        if id:
                context.addIndex(id, 'ZCTextIndex', extra)

--=20
paavo.

 "joskus voi t=E4=E4 meno k=E4yd=E4 ahdistavaksi
  kun on t=E4=E4ll=E4 muodostunut tavaksi
  muuttaa jokaisen el=E4m=E4n arvo rahaksi"