examples/gather.py

5 months ago

author
Cory Dodt <corymercurial@spam.goonmill.org>
date
Fri Oct 09 10:32:45 2009 -0700
changeset 139
d0a738aea316
parent 2
3b0b571962aa
permissions
-rw-r--r--

Added tag 0.8.4.1 for changeset bbc3e3a3c4fb

     1 # hypy version of the estraiernative gather/search example
     3 from hypy import HDatabase, HDocument
     5 # open the database
     6 db = HDatabase()
     7 db.open('casket', 'w')
     9 # create a document object
    10 doc = HDocument(uri=u'http://estraier.gov/example.txt')
    11 doc[u'@title'] = u'Over the Rainbow'
    13 # add the body text to the document object
    14 doc.addText(u"Somewhere over the rainbow.  Way up high.")
    15 doc.addText(u"There's a land that I heard of once in a lullaby.")
    17 # register the document object to the database
    18 db.putDoc(doc, clean=True)
    19 print "db.putDoc()"
    21 # close the database
    22 db.close()
    23 print "db.close()"

mercurial