[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Searching and Categorizing Content

webmaster at zope.org webmaster at zope.org
Thu Mar 4 08:40:20 EST 2004


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx#3-70

---------------

      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 """



More information about the ZDP mailing list