Reg. updating catalog indexes in bluebream
Joshua Immanuel <[email protected]>
| Newsgroups | gmane.comp.web.zope.bluebream,gmane.comp.web.zope.devel |
|---|---|
| Organization | HiPro IT Solutions Private Limited |
| Message-ID | <1308832981.2482.73.camel@jimman> |
Hello all,
I did the following while adding a new site
sm = site.getSiteManager()
intids = IntIds()
sm['intids'] = intids
sm.registerUtility(intids, IIntIds)
cat = Catalog()
sm['catalog'] = cat
sm.registerUtility(cat, ICatalog)
cat[u'client_name'] = TextIndex('name', IClient)
I ran into the debug shell prompt and checked the length of sm['initid']
after adding 'Client' objects via browser interface. It did reflected
the number of items added. But when I ran a search query in the shell
prompt there were no results
>>> len(sm['intids'])
4
>>> list(cat.apply({'client_name': 'xyz*'}))
[]
But when I updated the indexes, it gave out results.
>>> cat.updateIndexes()
>>> list(cat.apply({'client_name': 'xyz*'}))
[753759381]
I guess that I don't have to manually update the indexes each time when
an object is added/modified. Am I missing something?
--
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEABECAAYFAk4DNNUACgkQWw85XwuSFMInEQCeJOJyHoqiURpTptGk4W6eptRG GNsAoI6yGjOVQNBxXV6peDf7/yIg7Ciq =Sryk -----END PGP SIGNATURE-----