entities/adapters.py
branchstable
changeset 7815 2a164a9cf81c
parent 6974 6f23b2baf99b
child 7879 9aae456abab5
equal deleted inserted replaced
7814:1ec9fe1dfba9 7815:2a164a9cf81c
     1 # copyright 2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2010-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   135             weight = self.attr_weight.get(rschema, 'C')
   135             weight = self.attr_weight.get(rschema, 'C')
   136             try:
   136             try:
   137                 value = entity.printable_value(rschema, format='text/plain')
   137                 value = entity.printable_value(rschema, format='text/plain')
   138             except TransformError:
   138             except TransformError:
   139                 continue
   139                 continue
   140             except:
   140             except Exception:
   141                 self.exception("can't add value of %s to text index for entity %s",
   141                 self.exception("can't add value of %s to text index for entity %s",
   142                                rschema, entity.eid)
   142                                rschema, entity.eid)
   143                 continue
   143                 continue
   144             if value:
   144             if value:
   145                 words.setdefault(weight, []).extend(tokenize(value))
   145                 words.setdefault(weight, []).extend(tokenize(value))