code: def searchForMessages(self, query, offset=0, limit=5, thread_id=None):
          
          message_ids = self.searchForMessageIDs(
              query, offset=offset, limit=limit, thread_id=thread_id
          )
          for mid in message_ids:
              yield self.fetchMessageInfo(mid, thread_id)
docs: Find and get :class:`models.Message` objects by query
  
          .. warning::
              This method sends request for every found message ID.
  
          :param query: Text to search for
          :param offset: Number of messages to skip
          :param limit: Max. number of messages to retrieve
          :param thread_id: User/Group ID to search in. See :ref:`intro_threads`
          :type offset: int
          :type limit: int
          :return: Found :class:`models.Message` objects
          :rtype: generator
          :raises: FBchatException if request failed