Hello I have a catalog full of catalogue aware objects (about 2,000). When I search for items of the meta_type "Commentoid" I seem to to get ALL the objects, hence my if filter below. Am I doing something wrong in my script or is my catalog wrong? Thanks ###################### request = context.REQUEST cat = context.catalog size= int(size) objs = [ ] for item in cat.searchResults(meta_type='Commentoid'): rid = item.data_record_id_ path = cat.getpath(rid) obj = cat.getobject(rid, REQUEST=request) if obj.meta_type == 'Commentoid': objs.append(obj) if len(objs) == size: return objs return objs -- tom smith http://www.othermedia.com/blog/ 0207 089 5959 3rd Floor, The Pavilion, Newham's Row, London SE1 3UZ
tom smith wrote:
I have a catalog full of catalogue aware objects (about 2,000). When I search for items of the meta_type "Commentoid" I seem to to get ALL the objects, hence my if filter below. Am I doing something wrong in my script or is my catalog wrong?
just to be sure: you have created an index with index_name='meta_type' in your ZCatalog? cheers, maik -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
participants (2)
-
Maik Jablonski -
tom smith