'Search the library for tracks where ``field`` contains ``values``.
``field`` can be one of ``uri``, ``track_name``, ``album``, ``artist``,
``albumartist``, ``composer``, ``performer``, ``track_no``, ``genre``,
``date``, ``comment`` or ``any``.
If ``uris`` is given, the search is limited to results from within the
URI roots. For example passing ``uris=[\'file:\']`` will limit the search
to the local backend.
Examples::
# Returns results matching \'a\' in any backend
search({\'any\': [\'a\']})
# Returns results matching artist \'xyz\' in any backend
search({\'artist\': [\'xyz\']})
# Returns results matching \'a\' and \'b\' and artist \'xyz\' in any
# backend
search({\'any\': [\'a\', \'b\'], \'artist\': [\'xyz\']})
# Returns results matching \'a\' if within the given URI roots
# "file:///media/music" and "spotify:"
search({\'any\': [\'a\']}, uris=[\'file:///media/music\', \'spotify:\'])
# Returns results matching artist \'xyz\' and \'abc\' in any backend
search({\'artist\': [\'xyz\', \'abc\']})
:param query: one or more queries to search for
:type query: dict
:param uris: zero or more URI roots to limit the search to
:type uris: list of string or :class:`None`
:param exact: if the search should use exact matching
:type exact: :class:`bool`
:rtype: list of :class:`mopidy.models.SearchResult`
.. versionadded:: 1.0
The ``exact`` keyword argument, which replaces :meth:`find_exact`.
.. deprecated:: 1.0
Previously, if the query was empty, and the backend could support
it, all available tracks were returned. This has not changed, but
it is strongly discouraged. No new code should rely on this
behavior.
.. deprecated:: 1.1
Providing the search query via ``kwargs`` is no longer supported.'

def search(self, query=None, uris=None, exact=False, **kwargs):

    query = _normalize_query((query or kwargs))
    ((uris is None) or validation.check_uris(uris))
    ((query is None) or validation.check_query(query))
    validation.check_boolean(exact)
    if kwargs:
        deprecation.warn(u'core.library.search:kwargs_query')
    if (not query):
        deprecation.warn(u'core.library.search:empty_query')
    futures = {}
    for (backend, backend_uris) in self._get_backends_to_uris(uris).items():
        futures[backend] = backend.library.search(query=query, uris=backend_uris, exact=exact)
    reraise = (TypeError, LookupError)
    results = []
    for (backend, future) in futures.items():
        try:
            with _backend_error_handling(backend, reraise=reraise):
                result = future.get()
                if (result is not None):
                    validation.check_instance(result, models.SearchResult)
                    results.append(result)
        except TypeError:
            backend_name = backend.actor_ref.actor_class.__name__
            logger.warning(u'%s    does    not    implement    library.search()    with    "exact"    support.    Please    upgrade    it.', backend_name)
    return results
