[hooks/syncschema] use a list instead of a set for UpdateFTIndexOp
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 13 Feb 2015 13:39:33 +0100
changeset 10250 582301c2c8ca
parent 10249 e38b8d37c5d8
child 10251 2daa5c6dea4d
[hooks/syncschema] use a list instead of a set for UpdateFTIndexOp The order in which etypes get indexed matters. Related to #4959402.
hooks/syncschema.py
--- a/hooks/syncschema.py	Fri Feb 13 11:48:13 2015 +0100
+++ b/hooks/syncschema.py	Fri Feb 13 13:39:33 2015 +0100
@@ -319,8 +319,12 @@
         if 'fulltext_container' in self.values:
             op = UpdateFTIndexOp.get_instance(cnx)
             for subjtype, objtype in rschema.rdefs:
-                op.add_data(subjtype)
-                op.add_data(objtype)
+                if self.values['fulltext_container'] == 'subject':
+                    op.add_data(subjtype)
+                    op.add_data(objtype)
+                else:
+                    op.add_data(objtype)
+                    op.add_data(subjtype)
         # update the in-memory schema first
         self.oldvalues = dict( (attr, getattr(rschema, attr)) for attr in self.values)
         self.rschema.__dict__.update(self.values)
@@ -1313,6 +1317,7 @@
     We wait after the commit to as the schema in memory is only updated after
     the commit.
     """
+    containercls = list
 
     def postcommit_event(self):
         cnx = self.cnx