[Zope] Z Search Interface returns numbers

Luciano Ramalho ramalho at gmail.com
Tue Apr 10 17:43:43 EDT 2007

You missed a step: you must use the Metadata tab of the ZCatalog to
define which fields of the indexed objects should be returned with the
results from the search. After you do that, you'll have to update the
catalog (Advanced tab) and then regenerate your search interface.

For instance, to return the ids of the objects, add id as a metadata.
If you'd like to show the URL of each item, there is no need to set
metadata for that, since the records returned form the catalog have a
method called getUrl which gives you that. So you can use
record/getUrl, where record is the variable name used in the
tal:repeat statement which invokes the catalog search results.



On 4/10/07, Peppe Top <peppetop at gmail.com> wrote:
> I've diligently followed the tutorial about searching in the Zope book:
> http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx
> You basically:
> - create a ZCatalog object
> - create a Lexicon and an Index
> - finding objects and cataloging them
> - create a web interface (with Z Search Interface) to search the ZCatalog.
> When I search something in the SearchForm (via the "test" tab)
> I just get numbers. I mean the ReportForm correctly reports the
> objects containing the searched string, but lists handles (I guess).
> Is this normal?
> What can I do in order to get something like:
> /Zoo/Serpents
> /Zoo/Reptiles
> (the above are imaginary DTML documents matching
> the search criteria, and their path to ZODB root)
> instead of:
> 4567489
> 4567480
> ???
> Thanks a lot
> -- Peppe
> (Plone 2.1.2, Zope 2.8.7, Python 2.3.5, Red Hat Linux)
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

More information about the Zope mailing list