Example #1
0
 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')
Example #2
0
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"]]
Example #3
0
 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')
Example #4
0
 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')
Example #5
0
 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')