コード例 #1
0
 private function querySolr(SolrQuery $query, SolrFacetFilterRequest $facetFilterRequest) : SolrResponse
 {
     $queryParameters = $query->toArray();
     $facetParameters = $facetFilterRequest->toArray();
     $response = $this->client->select(array_merge($queryParameters, $facetParameters));
     return SolrResponse::fromSolrResponseArray($response, $this->facetFieldTransformationRegistry);
 }
 public function testSolrQuerySentToHttpClientContainsGlobalProductListingCriteria()
 {
     $searchString = 'foo';
     $filterSelection = [];
     $spy = $this->once();
     $this->mockHttpClient->expects($spy)->method('select')->willReturn([]);
     $this->searchEngine->queryFullText($searchString, $this->createStubQueryOptions($filterSelection));
     $queryString = $spy->getInvocations()[0]->parameters[0]['q'];
     $expectationRegExp = sprintf('/^\\(\\(\\(full_text_search:"%s"\\) AND %s:"%s"\\)\\)/', $searchString, $this->testGlobalProductListingCriteriaFieldName, $this->testGlobalProductListingCriteriaFieldValue);
     $this->assertRegExp($expectationRegExp, $queryString);
 }