BackTalk to Document The Zope Book (2.6 Edition)/Searching and Categorizing Content
[email protected] Wed, 28 Apr 2004 10:11:28 -0400
| Newsgroups | gmane.comp.web.zope.zdp |
|---|---|
| Message-ID | <[email protected]> |
A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx#3-71
---------------
Querying a ZCTextIndex with these advanced features works just
like querying it with the original simple features. In the HTML
search form for DTML Documents, for example, you could enter
"Koala AND Lion" and get all documents about Koalas and Lions.
Querying a ZCTextIndex from Python with advanced features works
much the same; suppose you want to change your
'relevantSectionNews' Script to not include any news items that
contain the word "catastrophic"::
## Script (Python) "relevantSectionNews"
##
""" Returns relevant, non-catastropic news """"
id=context.getId()
return context.NewsCatalog(
{'contentTextIdx' : id + ' -catastrophic'}
)
% guillaume_benoit - Mar. 4, 2004 8:40 am:
Little error:
""" Returns relevant, non-catastropic news """"
... should be ...
""" Returns relevant, non-catastropic news """
% Anonymous User - Apr. 28, 2004 10:11 am:
or even better:
""" Returns relevant, non-catastrophic news """
_______________________________________________
ZDP maillist - [email protected]
http://mail.zope.org/mailman/listinfo/zdp