Download presentation
Presentation is loading. Please wait.
Published byKaterina Whitebread Modified over 10 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.