[entities] do not serialize containers of File

it is responsability of containers to serialize some content for elasticsearch

authorSamuel Trégouët <samuel.tregouet@logilab.fr>
changesetf7ba57fef472
branchdefault
phasedraft
hiddenyes
parent revision#98d546d70af9 [hook] move delete es document in method and catch not found error
child revision#df3a0d500c14 [hook] content of fulltext_containers relation should rely on container
files modified by this revision
cubicweb_elasticsearch/entities.py
# HG changeset patch
# User Samuel Trégouët <samuel.tregouet@logilab.fr>
# Date 1489146026 -3600
# Fri Mar 10 12:40:26 2017 +0100
# Node ID f7ba57fef472890a2784b6d71dc80852089482bd
# Parent 98d546d70af92ad2fb8e5bbd2ddd26b994121c14
[entities] do not serialize containers of File

it is responsability of containers to serialize some content for
elasticsearch

diff --git a/cubicweb_elasticsearch/entities.py b/cubicweb_elasticsearch/entities.py
@@ -121,8 +121,7 @@
1          for Files
2          """
3          for rschema, role in self._cw.vreg.schema['File'].fulltext_containers():
4              for parent in self.entity.related(
5                      rschema.type, role=neg_role(role)).entities():
6 -                return parent.cw_adapt_to(
7 -                    'IFullTextIndexSerializable').serialize(complete)
8 +                return
9          return {}