Main Query Function¶
-
solr_conabio.
query
(host, collection, query=None, extra='', facet=None, rows=None, start=None, group=None, additional_queries=None, collapse=None, frmt='json', fq=None, fl=None)[source] Make query to solar and return results.
Parameters: - host : str
Host name of solr server
- collection : str
Collection from which to query
- query : dict, optional
Query configuration. See
_generate_query()
. If no query is provided, all documents will be returned (limited by the rows argument).- extra : str, optional
A string to be appended to the query url. Defaults to empty string.
- facet : dict, optional
Facet configuration. See
_generate_facet()
. If no facet configuration is provided no facet will be included.- rows : int, optional
Number of documents to return from query. Defaults to 10.
- start : int, optional
Index of document at which to start querying. Defaults to 0.
- group : dict, optional
Group configuration. See
_generate_group()
. If no group configurations are provided no grouping will occur.- additional_queries : dict or list or tuple, optional
Single or mutiple queries to add.
- collapse : dict, optional
Collapse configuration. See
_generate_collapse()
. If no collapse configurations are provided no collapse will occur.- frmt : str, optional
Format of solr response. Defaults to json.
- fq : dict, optional
Query configuration to use as filter query parameter. See
_generate_query()
. If no configuration is provided no filter query will be used.- fl : list or tuple, optional
Field list parameter. Only fields included in this list will be returned by solr.
Returns: - data : frmt
Solar response in the desired format (frmt)