Search

class moxie.core.search.SearchResponse(raw_response, query, size, results=None, query_suggestion=None, facets=None)
as_dict

Raw response as a dict :rtype dict

as_json

Raw response as JSON :rtype string of JSON

facets

Facets of the query :rtype list of facets

query

String of the query (FTS) :rtype string

query_suggestion

Suggestion of a new query :return query suggestion :rtype string

results

Response documents :return list of dict or None if no results :rtype list of dict

size

Size of the search result

exception moxie.core.search.SearchServerException(message=None, status_code=None, payload=None, headers=None)
message = 'Search service not available'
class moxie.core.search.SearchService(backend_uri)

Represents the abstraction between our Search implementation (by default, Apache Solr) and the public API. For configuration details, see the Service documentation.

All Search requests should be made through this service.

static _get_backend(backend_uri)

Parse the URI and imports the appropriate Search implementation The backend_uri schema is as follows: implementation+transport://domain/path/collection where:

implementation
is the name of a supported scheme in moxie.core.search.SEARCH_SCHEMES.
collection
name used by the backend to identify your index.
Parameters:backend_uri – URI Representing your search implementation e.g. solr+http://example.com/solr/collection
Returns:Searcher implementation.
commit()
get_by_ids(ids)
healthcheck()
index(document, **kwargs)
search(query, fq=None, start=0, count=10)

Generic search query :param query: dict of k/v corresponding to parameters to search :return moxie.core.search.SearchResponse

search_for_ids(id_key, identifiers)
suggest(query, fq=None, start=0, count=10)