[Zope-Coders] Proposal for minor ZCatalog improvement
Casey Duncan
casey@zope.com
Mon, 11 Nov 2002 11:15:41 -0500
On Monday 11 November 2002 10:15 am, Andreas Jung wrote:
> --On Montag, 11. November 2002 09:56 -0500 Shane Hathaway <shane@zope.c=
om>=20
> wrote:
>=20
> > Andreas Jung wrote:
> >> All ZCatalog indexes are using the id of the indexes to index attrib=
utes
> >> with the same name. ZCTextIndex introduced a new approach by seperat=
ing
> >> the id of the index from the attribute name to be indexed. This is a=
nice
> >> idea and allows to have different indexes on the same attribute name
> >> (e.g. having a FieldIndex and a text index on a string attribute).
> >>
> >> I propose add this functionality to all Zope indexes. All interface =
for
> >> pluggable indexes should get a new method getIndexedAttribute() that
> >> returns the name of the attribute that will be indexed by this index=
=2E
> >> The indexes tab of the ZCatalog should be modified to display the
> >> indexes as:
> >>
> >> topic_txt (TextIndex on topic) ...
> >> topic_field (FieldIndex on topic)
> >>
> >> For backwards compatiblity getIndexedAttribute() would return the
> >> id of the index if the indexes has no dedicated attribute to keep
> >> the name of the indexed attribute.
> >
> > This is a good thing to point out, but what about the possibility of
> > allowing ZCTextIndexes to index multiple attributes? Currently we ha=
ve
> > "SearchableText()" methods all over that return "self.description + '=
' +
> > self.title + ' ' + self.body". We could instead let the ZCTextIndex
> > perform that work, making it more configurable.
>=20
> But that is an index related thing and is not directly ZCatalog related
I agree, ZCatalog would not care. But I do think that would be a nice=20
enhancement for ZCTextIndex.
=20
> >
> > This would make getIndexedAttribute() impossible to implement correct=
ly.
> > Maybe getIndexedAttributeNames()?
Maybe getIndexSourceName? I'm not sure if returning a list buys us anythi=
ng,=20
but if it does then getIndexSourceNames
-Casey