[Zope] ZCatalog PathIndex Query

Nathan Colgate Clark nathancolgate at gmail.com
Mon Mar 14 19:09:13 EST 2005


In an 'advanced search' interface i would like to provide the ability
to search using the path index of my catalog (index id: 'p', catalog
id: 'Catalog').

A sample of my catalog:
/site_root/publications
/site_root/publications/newsletter
/site_root/publications/newsletter/edition01/articleA
/site_root/publications/newsletter/edition01/articleB
/site_root/publications/magazine
/site_root/publications/magazine/fall2003/articleC
/site_root/publications/magazine/fall2003/articleD
/site_root/publications/magazine/winter2003/articleE
/site_root/publications/magazine/spring2003/articleF

So that if the user were to type "magazine" into the field they would
get the last 5 objects in my catalog.

however, this does not work right now.  currently i have to type
"/site_root/publications/magazine" into the field.  this is becuase
the default level for pathIndex searches is 0 (line 154 of
PathIndex.py).  to change this I must pass the argument as a tuple
(query,level) with the level set to -1.  My question is this:  how do
I do that using the get method of a form? how do I pass the
(query,level) tuple from the form in the URL?

I have tried this:
http://www.mysite.com/search?p=magazine&p=-1

which gives me a p variable of:
['magazine','-1']
but still does not give me any results.


More information about the Zope mailing list