Skip to content
Snippets Groups Projects
Commit b45459be authored by Lionel Walter's avatar Lionel Walter Committed by Robert Lange
Browse files

Enable search with solr parameter facet.contains (#1378)

parent 10bc1978
No related merge requests found
......@@ -42,6 +42,22 @@ class Params extends \VuFind\Search\Base\Params
{
use \VuFind\Search\Params\FacetLimitTrait;
/**
* Search with facet.contains
* cf. https://lucene.apache.org/solr/guide/7_3/faceting.html
*
* @var string
*/
protected $facetContains = null;
/**
* Ignore Case when using facet.contains
* cf. https://lucene.apache.org/solr/guide/7_3/faceting.html
*
* @var bool
*/
protected $facetContainsIgnoreCase = null;
/**
* Offset for facet results
*
......@@ -196,6 +212,13 @@ class Params extends \VuFind\Search\Base\Params
}
$facetSet['field'][] = $facetField;
}
if ($this->facetContains != null) {
$facetSet['contains'] = $this->facetContains;
}
if ($this->facetContainsIgnoreCase != null) {
$facetSet['contains.ignoreCase']
= $this->facetContainsIgnoreCase ? 'true' : 'false';
}
if ($this->facetOffset != null) {
$facetSet['offset'] = $this->facetOffset;
}
......@@ -232,6 +255,30 @@ class Params extends \VuFind\Search\Base\Params
}
}
/**
* Set Facet Contains
*
* @param string $p the new contains value
*
* @return void
*/
public function setFacetContains($p)
{
$this->facetContains = $p;
}
/**
* Set Facet Contains Ignore Case
*
* @param bool $val the new boolean value
*
* @return void
*/
public function setFacetContainsIgnoreCase($val)
{
$this->facetContainsIgnoreCase = $val;
}
/**
* Set Facet Offset
*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment