[Grok-dev] Catalog/Indexes/Search error

Paul Wilson paulalexwilson at gmail.com
Thu Jan 7 09:59:10 EST 2010


2010/1/7 Martijn Faassen <faassen at startifact.com>:
> I don't have any versions problems in a Grok 1.0. I get the zc.catalog
> 1.2. So it must be hurry.query! hurry.query is *not* locked down in
> versions.cfg. You should be using 0.9.2 or 0.9.3, *not* hurry.query 1.0.

*Kathy*:

In some reasonable directory on your box you need to get hold of
hurry.query version 0.9.3:

%> svn co http://codespeak.net/svn/z3/hurry.query/tag/hurry.query-0.9.3/
hurry.query
%> cd hurry.query
%> python setup.py install

The last line should install this version into your Python path -
perhaps within a virtualenv.
You need to pin this version on your versions.cfg:

hurry.query = 0.9.3

I've also pinned zc.catalog to 1.3.0, but Martijn tells me that 1.2.0 is fine.

*Revert all changes to your version.cfg file too*

Rerun buildout and make sure it runs fine. If it doesn't, double check
everything and come back to the list... we'll help you. Restart the
server and you can now add applications to the ZODB without system
error. When visiting:

localhost:8080/newpackage/addobjects

I see the page display:

"Done... 10 objects"

When I visit:

localhost:8080/newpackage/protonsearch?search=where

I get the return string from the expedient render method that I had to
add. So I've changed it read:

------------%<-----------
 86     def render(self):
 87         s = "Found %d results\n" % len(self.text_search)
 88         for result in self.text_search:
 89             s += "Found: %s\n" % result.body
 90         return s
------------%<-----------

Seems to find results when I use:

localhost:8080/newpackage/protonsearch?search=where
localhost:8080/newpackage/protonsearch?search=what
localhost:8080/newpackage/protonsearch?search=how

...etc...

I'm convinced that Sebastian has a template file that he can share
that will format things better than this.

Oh,  and there was a typo in 'update' within ProtonSearch, it should read:

------------%<-----------
 82     def update(self, search=""):
 83         if len(search) > 1:
 84             self.field_search, self.text_search =
self.search_content(search)
------------%<-----------

Good luck!

Paul


More information about the Grok-dev mailing list