<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def recherche(self, pattern, entete, in_all=False):
 """abstractSearch in fields of collection and reset rendering. Returns number of results. If in_all is True, call get_all before doing the search."""

        if in_all:
            self.collection = self.get_all()
        self.collection.recherche(pattern, entete)
        self._reset_render()
        return len(self.collection)