def text_query(self, search_model: FullTextModel):
self.logger.debug('<STR_LIT>'.format(search_model.text))<EOL>if search_model.sort is not None:<EOL><INDENT>self._mapping_to_sort(search_model.sort.keys())<EOL>sort = self._sort_object(search_model.sort)<EOL><DEDENT>else:<EOL><INDENT>sort = [{"<STR_LIT>": "<STR_LIT>"}]<EOL><DEDENT>body = {<EOL>'<STR_LIT>': sort,<EOL>'<STR_LIT>': (search_model.page - <NUM_LIT:1>) * search_model.offset,<EOL>'<STR_LIT:size>': search_model.offset,<EOL>}<EOL>page = self.driver._es.search(<EOL>index=self.driver._index,<EOL>doc_type='<STR_LIT>',<EOL>body=body,<EOL>q=search_model.text<EOL>)<EOL>object_list = []<EOL>for x in page['<STR_LIT>']['<STR_LIT>']:<EOL><INDENT>object_list.append(x['<STR_LIT>'])<EOL><DEDENT>return object_list<EOL>
Query elasticsearch for objects.
        :param search_model: object of FullTextModel
        :return: list of objects that match the query.