Don't assume script is present
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 14 Jun 2011 17:16:17 -0700
changeset 35 eb9808033c351e0ac76f131ca761f3cbf2714e7b
parent 34 51afbd7578ffc80ec6c235d5ecce6dbd33ebcb6b
child 36 b87730b654132d4c0bf691c57b34e632beedc95e
push id36
push userjgriffin@mozilla.com
push dateWed, 15 Jun 2011 00:16:29 +0000
Don't assume script is present
mozautoeslib/eslib.py
--- a/mozautoeslib/eslib.py
+++ b/mozautoeslib/eslib.py
@@ -280,17 +280,17 @@ class ESLib(object):
 
     boolquery = self._make_bool_query(include, exclude)
 
     q = Search(query=boolquery, size=0)
     for field in frequency_fields:
       if type(field) == basestring:
         q.facet.add_term_facet(field, size=size)
       else:
-        q.facet.add_term_facet(field['field'], size=size, script=field['script'])
+        q.facet.add_term_facet(field['field'], size=size, script=field.get('script'))
 
     result = self.connection.search(query=q,
                                     indexes=[self.read_index],
                                     doc_types=self.doc_type)
 
     if 'facets' in result:
       return result['facets']