Presentation is loading. Please wait.

Presentation is loading. Please wait.

What's In A Catalog? A Quick Introduction. Role of Catalogs Native ZODB can only find by path Catalogs provide all other lookups Catalogs are lazy!

Similar presentations


Presentation on theme: "What's In A Catalog? A Quick Introduction. Role of Catalogs Native ZODB can only find by path Catalogs provide all other lookups Catalogs are lazy!"— Presentation transcript:

1 What's In A Catalog? A Quick Introduction

2 Role of Catalogs Native ZODB can only find by path Catalogs provide all other lookups Catalogs are lazy!

3 Catalogs Interface: Zope/lib/python/ZCatalog/interfaces.py Methods: searchResults(REQUEST=None, **kw) e.g.: searchResults(Topic=topic,Title=title) catalog_object(obj, uid …) uncatalog_object(uid) uniqueValuesFor(name)

4 Cataloging An Object All object attributes matching an index name are indexed All object attributes matching a metadata name are stored with index record (brain) Callable attributes are called to get data E.G., SearchableText

5 Querying A Catalog Simple: searchResults(indexName=value) Pseudo Indices: sort_on sort_order ("reverse") sort_limit

6 Index Types ZCTextIndex Full-Text, And, Or, Not, Quote operations Field Keyword Path / ExtendedPath DateIndex / DateRangeIndex TextIndexNG

7 Complex Queries Record Queries searchResults( categories={ 'query':['big','shiny'], 'operator':'and' }) Different for every Index Type

8 Catalog Brains Brain Methods: getObject() getURL() getPath() Brain Attributes: The metadata! But … not the index items! Brain Source: Zope/lib/python/ZCatalog/CatalogBrains.py

9 Archetypes Catalog Support Automatic Reindexing Searchable field attribute Adds field value to SearchableText Index field attribute Adds a portal_catalog index and (optionally) metadata


Download ppt "What's In A Catalog? A Quick Introduction. Role of Catalogs Native ZODB can only find by path Catalogs provide all other lookups Catalogs are lazy!"

Similar presentations


Ads by Google