def test_1030(self): """search(): q + fq + fl query returns expected results.""" solr_client = d1_client.solr_client.SolrClient(CN_RESPONSES_BASE_URL) solr_dict = solr_client.search(**self.span_limit( SHORT_SPAN, q='id:a*', fl=['id', 'checksum', 'dateUploaded'])) self._delete_volatile_keys(solr_dict) self.sample.assert_equals(solr_dict, 'search_expected')
async def get_random_pid_list(solr_client, format_id, pid_count): """Query Solr for a list of randomly selected PIDs of objects with a given formatId.""" search_result = solr_client.search( q=Param("formatId", format_id), rows=pid_count, fl=["id", "formatIdx"], sort="random_{} desc".format(random.randint(10000, 99999)), ) return [d["id"] for d in search_result["response"]["docs"]]
def test_1030(self): """search(): q + fq + fl query returns expected results.""" solr_client = d1_client.solr_client.SolrClient(CN_RESPONSES_BASE_URL) solr_dict = solr_client.search( **self.span_limit( SHORT_SPAN, q='id:a*', fl=['id', 'checksum', 'dateUploaded'] ) ) self._delete_volatile_keys(solr_dict) self.sample.assert_equals(solr_dict, 'search_expected')
def test_1020(self): """search(): Query with no results returns valid dict.""" solr_client = d1_client.solr_client.SolrClient(CN_RESPONSES_BASE_URL) solr_dict = solr_client.search(q='id:invalid_solr_record_id') self._delete_volatile_keys(solr_dict) self.sample.assert_equals(solr_dict, 'search_no_results')