Exemple #1
0
 public function testSetAndGetContains()
 {
     $this->facet->setContains('foobar');
     $this->assertEquals('foobar', $this->facet->getContains());
 }
Exemple #2
0
 /**
  * Add params for a field facet to request.
  *
  * @param Request    $request
  * @param FacetField $facet
  */
 public function addFacetField($request, $facet)
 {
     $field = $facet->getField();
     $request->addParam('facet.field', $this->renderLocalParams($field, array('key' => $facet->getKey(), 'ex' => $facet->getExcludes())));
     $request->addParam("f.{$field}.facet.limit", $facet->getLimit());
     $request->addParam("f.{$field}.facet.sort", $facet->getSort());
     $request->addParam("f.{$field}.facet.prefix", $facet->getPrefix());
     $request->addParam("f.{$field}.facet.contains", $facet->getContains());
     $request->addParam("f.{$field}.facet.contains.ignoreCase", is_null($ignoreCase = $facet->getContainsIgnoreCase()) ? null : ($ignoreCase ? 'true' : 'false'));
     $request->addParam("f.{$field}.facet.offset", $facet->getOffset());
     $request->addParam("f.{$field}.facet.mincount", $facet->getMinCount());
     $request->addParam("f.{$field}.facet.missing", $facet->getMissing());
     $request->addParam("f.{$field}.facet.method", $facet->getMethod());
 }