[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Searching and Categorizing Content
webmaster@zope.org
webmaster@zope.org
Tue, 07 Jan 2003 17:34:14 -0500
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/SearchingZCatalog.stx#3-32
---------------
When you catalog an object the Catalog uses each index to
examine the object. The catalog consults attributes and methods
to find an object's value for each index. For example, in the
case of the DTML Documents cataloged with a
*PrincipiaSearchSource* index, the Catalog calls each document's
*PrincipiaSearchSource* method and records the results in its
*PrincipiaSearchSource* index. If the Catalog cannot find an
attribute or method for an index, then it ignores it. In other
words it's fine if an object does not support a given
index. There are four kinds of indexes:
TextIndex -- Searches text. Use this kind of index when you
want a full-text search.
FieldIndex -- Searches objects for specific values. Use this
kind of index when you want to search date objects, numbers, or
specific strings.
KeywordIndex -- Searches collections of specific values. This
index is like a FieldIndex, but it allows you to search
collections rather than single values.
PathIndex -- Searches for all objects that contain certain URL
path elements. For example, you could search for all the
objects whose paths begin with '/Animals/Zoo'.
% Anonymous User - June 20, 2002 9:35 pm:
TopicIndex --
Searches among FilteredSets; each set contains the document IDs of documents
which match the set's filter expression. Use this kind of index to optimize
frequently-accessed searches.
DateIndex --
A subclass of FieldIndex, optimized for date-time values. Use this index
for any field known to be a date or a date-time.
DateRangeIndex --
Searches objects based on a pair of dates / date-times. Use this index to
search for objects which are "current" or "in effect" at a given time.
% Anonymous User - Jan. 7, 2003 5:34 pm:
Not mentioned at all here is that the way you establish the index for an object is to add Properties for that
index. The Property names should exactly match the names that will be indexed.