Commits

Anonymous committed 30a1b46

updated Xapian paths linking to config file

  • Participants
  • Parent commits d1d5b5e

Comments (0)

Files changed (2)

openletters/command.py

 '''
 import unicodedata, urllib, os
 
+from pylons import request, response, session, tmpl_context as c, config
 #from ofs.local import OFS
 from xml.dom import minidom
 
     
     #database = xapian.WritableDatabase(db_path, xapian.DB_CREATE_OR_OPEN)
     #open a writable database on the xapian-tcpsrvr
-    database = xapian.remote_open_writable("localhost/correspondence", 33333)
+    database = xapian.remote_open_writable(config['xapian_host'], int(config['xapian_port']))
+    #database = xapian.remote_open_writable("localhost", 33333)
     indexer = xapian.TermGenerator()
     indexer.set_stemmer(xapian.Stem('english'))
     

openletters/controllers/search.py

         if queryString:
             # Connect to database
             try:
-                database = xapian.remote_open(config['xapian_host'], config['xapian_port'])
+                database = xapian.remote_open(config['xapian_host'], int(config['xapian_port']))
+               # database = xapian.remote_open(config['xapian_host'], config['xapian_port'])
             except xapian.DatabaseOpeningError:
                 return 'Cannot open database at ' + config['xapian_host'] + "on port:" + config['xapian_port']
             # Parse query string