code: def search_titles(self, title):
          
          # make the query
          logger.info('Searching title %r', title)
          r = self.session.get(self.server_url + 'legenda/sugestao/{}'.format(title), timeout=10)
          r.raise_for_status()
          results = json.loads(r.text)
  
          # loop over results
          titles = {}
          for result in results:
              source = result['_source']
  
              # extract id
              title_id = int(source['id_filme'])
  
              # extract type and title
              title = {'type': type_map[source['tipo']], 'title': source['dsc_nome']}
  
              # extract year
              if source['dsc_data_lancamento'] and source['dsc_data_lancamento'].isdigit():
                  title['year'] = int(source['dsc_data_lancamento'])
  
              # extract imdb_id
              if source['id_imdb'] != '0':
                  if not source['id_imdb'].startswith('tt'):
                      title['imdb_id'] = 'tt' + source['id_imdb'].zfill(7)
                  else:
                      title['imdb_id'] = source['id_imdb']
  
              # extract season
              if title['type'] == 'episode':
                  if source['temporada'] and source['temporada'].isdigit():
                      title['season'] = int(source['temporada'])
                  else:
                      match = season_re.search(source['dsc_nome_br'])
                      if match:
                          title['season'] = int(match.group('season'))
                      else:
                          logger.warning('No season detected for title %d', title_id)
  
              # add title
              titles[title_id] = title
  
          logger.debug('Found %d titles', len(titles))
  
          return titles
docs: Search for titles matching the `title`.
  
          :param str title: the title to search for.
          :return: found titles.
          :rtype: dict