def search(self, query, mediatype=None, limit=None):
results = []<EOL>params = {'<STR_LIT>': query}<EOL>if mediatype:<EOL><INDENT>params['<STR_LIT>'] = utils.SEARCHTYPES[mediatype]<EOL><DEDENT>if limit:<EOL><INDENT>params['<STR_LIT>'] = limit<EOL><DEDENT>key = '<STR_LIT>' % urlencode(params)<EOL>for hub in self.fetchItems(key, Hub):<EOL><INDENT>results += hub.items<EOL><DEDENT>return results<EOL>
Returns a list of media items or filter categories from the resulting
            `Hub Search <https://www.plex.tv/blog/seek-plex-shall-find-leveling-web-app/>`_
            against all items in your Plex library. This searches genres, actors, directors,
            playlists, as well as all the obvious media titles. It performs spell-checking
            against your search terms (because KUROSAWA is hard to spell). It also provides
            contextual search results. So for example, if you search for 'Pernice', it’ll
            return 'Pernice Brothers' as the artist result, but we’ll also go ahead and
            return your most-listened to albums and tracks from the artist. If you type
            'Arnold' you’ll get a result for the actor, but also the most recently added
            movies he’s in.

            Parameters:
                query (str): Query to use when searching your library.
                mediatype (str): Optionally limit your search to the specified media type.
                limit (int): Optionally limit to the specified number of results per Hub.