nodes: 0, module; 1, function_definition; 2, function_name:text_search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:text; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, assert_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, identifier:sort; 16, None; 17, identifier:offset; 18, integer:100; 19, identifier:page; 20, integer:1; 21, comment:"""
          Search in aquarius using text query.
  
          Given the string aquarius will do a full-text query to search in all documents.
  
          Currently implemented are the MongoDB and Elastic Search drivers.
  
          For a detailed guide on how to search, see the MongoDB driver documentation:
          mongodb driverCurrently implemented in:
          https://docs.mongodb.com/manual/reference/operator/query/text/
  
          And the Elastic Search documentation:
          https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html
          Other drivers are possible according to each implementation.
  
          :param text: String to be search.
          :param sort: 1/-1 to sort ascending or descending.
          :param offset: Integer with the number of elements displayed per page.
          :param page: Integer with the number of page.
          :return: List of DDO instance
          """; 22, comparison_operator:page >= 1; 23, string; 24, assignment; 25, assignment; 26, comparison_operator:response.status_code == 200; 27, block; 28, else_clause; 29, identifier:page; 30, integer:1; 31, string_content:Invalid page value; 32, interpolation; 33, string_content:. Required page >= 1.; 34, identifier:payload; 35, dictionary; 36, identifier:response; 37, call; 38, attribute; 39, integer:200; 40, return_statement; 41, block; 42, identifier:page; 43, pair; 44, pair; 45, pair; 46, pair; 47, attribute; 48, argument_list; 49, identifier:response; 50, identifier:status_code; 51, call; 52, raise_statement; 53, string:"text"; 54, identifier:text; 55, string:"sort"; 56, identifier:sort; 57, string:"offset"; 58, identifier:offset; 59, string:"page"; 60, identifier:page; 61, attribute; 62, identifier:get; 63, string; 64, keyword_argument; 65, keyword_argument; 66, attribute; 67, argument_list; 68, call; 69, identifier:self; 70, identifier:requests_session; 71, interpolation; 72, string_content:/query; 73, identifier:params; 74, identifier:payload; 75, identifier:headers; 76, attribute; 77, identifier:self; 78, identifier:_parse_search_response; 79, attribute; 80, identifier:Exception; 81, argument_list; 82, attribute; 83, identifier:self; 84, identifier:_headers; 85, identifier:response; 86, identifier:content; 87, string; 88, identifier:self; 89, identifier:url; 90, string_content:Unable to search for DDO:; 91, interpolation; 92, attribute; 93, identifier:response; 94, identifier:content
code: def text_search(self, text, sort=None, offset=100, page=1):
          """
          Search in aquarius using text query.
  
          Given the string aquarius will do a full-text query to search in all documents.
  
          Currently implemented are the MongoDB and Elastic Search drivers.
  
          For a detailed guide on how to search, see the MongoDB driver documentation:
          mongodb driverCurrently implemented in:
          https://docs.mongodb.com/manual/reference/operator/query/text/
  
          And the Elastic Search documentation:
          https://www.elastic.co/guide/en/elasticsearch/guide/current/full-text-search.html
          Other drivers are possible according to each implementation.
  
          :param text: String to be search.
          :param sort: 1/-1 to sort ascending or descending.
          :param offset: Integer with the number of elements displayed per page.
          :param page: Integer with the number of page.
          :return: List of DDO instance
          """
          assert page >= 1, f'Invalid page value {page}. Required page >= 1.'
          payload = {"text": text, "sort": sort, "offset": offset, "page": page}
          response = self.requests_session.get(
              f'{self.url}/query',
              params=payload,
              headers=self._headers
          )
          if response.status_code == 200:
              return self._parse_search_response(response.content)
          else:
              raise Exception(f'Unable to search for DDO: {response.content}')