[Zope-CVS] CVS: Products/ZCTextIndex - ZCTextIndex.py:1.17

Guido van Rossum guido@python.org
Mon, 20 May 2002 16:29:30 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv19223

Modified Files:
	ZCTextIndex.py 
Log Message:
_apply_index(): return None when the query string is empty.

I'm unclear whether this is really the right thing, but at least this
prevents crashes when nothing is entered in the search box.


=== Products/ZCTextIndex/ZCTextIndex.py 1.16 => 1.17 ===
             return None
         query_str = ' '.join(record.keys)
+        if not query_str:
+            return None
         tree = QueryParser(self.lexicon).parseQuery(query_str)
         results = tree.executeQuery(self.index)
         return  results, (self._fieldname,)