nodes: 0, module; 1, function_definition; 2, function_name:search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:text; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, default_parameter; 16, expression_statement; 17, expression_statement; 18, if_statement; 19, if_statement; 20, if_statement; 21, if_statement; 22, if_statement; 23, expression_statement; 24, return_statement; 25, identifier:includes; 26, None; 27, identifier:doc_type; 28, None; 29, identifier:limit; 30, None; 31, identifier:autocomplete; 32, False; 33, identifier:promulgated_only; 34, False; 35, identifier:tags; 36, None; 37, identifier:sort; 38, None; 39, identifier:owner; 40, None; 41, identifier:series; 42, None; 43, string; 44, assignment; 45, call; 46, block; 47, comparison_operator:limit is not None; 48, block; 49, identifier:autocomplete; 50, block; 51, comparison_operator:tags is not None; 52, block; 53, call; 54, block; 55, else_clause; 56, assignment; 57, subscript; 58, string_content:Search for entities in the charmstore.
  
          @param text The text to search for.
          @param includes What metadata to return in results (e.g. charm-config).
          @param doc_type Filter to this type: bundle or charm.
          @param limit Maximum number of results to return.
          @param autocomplete Whether to prefix/suffix match search terms.
          @param promulgated_only Whether to filter to only promulgated charms.
          @param tags The tags to filter; can be a list of tags or a single tag.
          @param sort Sorting the result based on the sort string provided
              which can be name, author, series and - in front for descending.
          @param owner Optional owner. If provided, search results will only
              include entities that owner can view.
          @param series The series to filter; can be a list of series or a
              single series.; 59, identifier:queries; 60, call; 61, identifier:len; 62, argument_list; 63, expression_statement; 64, identifier:limit; 65, None; 66, expression_statement; 67, expression_statement; 68, identifier:tags; 69, None; 70, if_statement; 71, expression_statement; 72, identifier:len; 73, argument_list; 74, expression_statement; 75, block; 76, identifier:data; 77, call; 78, call; 79, string; 80, attribute; 81, argument_list; 82, identifier:text; 83, call; 84, call; 85, call; 86, comparison_operator:type(tags) is list; 87, block; 88, call; 89, identifier:queries; 90, assignment; 91, expression_statement; 92, attribute; 93, argument_list; 94, attribute; 95, argument_list; 96, string_content:Results; 97, identifier:self; 98, identifier:_common_query_parameters; 99, identifier:doc_type; 100, identifier:includes; 101, identifier:owner; 102, identifier:promulgated_only; 103, identifier:series; 104, identifier:sort; 105, attribute; 106, argument_list; 107, attribute; 108, argument_list; 109, attribute; 110, argument_list; 111, call; 112, identifier:list; 113, expression_statement; 114, attribute; 115, argument_list; 116, identifier:url; 117, call; 118, assignment; 119, identifier:self; 120, identifier:_get; 121, identifier:url; 122, identifier:data; 123, identifier:json; 124, identifier:queries; 125, identifier:append; 126, tuple; 127, identifier:queries; 128, identifier:append; 129, tuple; 130, identifier:queries; 131, identifier:append; 132, tuple; 133, identifier:type; 134, argument_list; 135, assignment; 136, identifier:queries; 137, identifier:append; 138, tuple; 139, attribute; 140, argument_list; 141, identifier:url; 142, call; 143, string; 144, identifier:text; 145, string; 146, identifier:limit; 147, string; 148, integer:1; 149, identifier:tags; 150, identifier:tags; 151, call; 152, string; 153, identifier:tags; 154, string; 155, identifier:format; 156, attribute; 157, call; 158, attribute; 159, argument_list; 160, string_content:text; 161, string_content:limit; 162, string_content:autocomplete; 163, attribute; 164, argument_list; 165, string_content:tags; 166, string_content:{}/search?{}; 167, identifier:self; 168, identifier:url; 169, identifier:urlencode; 170, argument_list; 171, string; 172, identifier:format; 173, attribute; 174, string; 175, identifier:join; 176, identifier:tags; 177, identifier:queries; 178, string_content:{}/search; 179, identifier:self; 180, identifier:url; 181, string_content:,
code: def search(self, text, includes=None, doc_type=None, limit=None,
                 autocomplete=False, promulgated_only=False, tags=None,
                 sort=None, owner=None, series=None):
          '''
          Search for entities in the charmstore.
  
          @param text The text to search for.
          @param includes What metadata to return in results (e.g. charm-config).
          @param doc_type Filter to this type: bundle or charm.
          @param limit Maximum number of results to return.
          @param autocomplete Whether to prefix/suffix match search terms.
          @param promulgated_only Whether to filter to only promulgated charms.
          @param tags The tags to filter; can be a list of tags or a single tag.
          @param sort Sorting the result based on the sort string provided
              which can be name, author, series and - in front for descending.
          @param owner Optional owner. If provided, search results will only
              include entities that owner can view.
          @param series The series to filter; can be a list of series or a
              single series.
          '''
          queries = self._common_query_parameters(doc_type, includes, owner,
                                                  promulgated_only, series, sort)
          if len(text):
              queries.append(('text', text))
          if limit is not None:
              queries.append(('limit', limit))
          if autocomplete:
              queries.append(('autocomplete', 1))
          if tags is not None:
              if type(tags) is list:
                  tags = ','.join(tags)
              queries.append(('tags', tags))
          if len(queries):
              url = '{}/search?{}'.format(self.url, urlencode(queries))
          else:
              url = '{}/search'.format(self.url)
          data = self._get(url)
          return data.json()['Results']