Commit cb0f6eef authored by thomascorthals's avatar thomascorthals Committed by Markus Kalkbrenner

Added 'contains' and 'containsignorecase' to FacetSet docs (#588)

* Added 'contains' and 'containsignorecase' to FacetSet docs

* Added Solr version for facet.contains to docs

* Removed erroneous FacetSet comments from Facet Field PHPDoc
parent 665fa810
This facet type allows you to count the number of occurences of a term in a specific field.
This facet type allows you to count the number of occurrences of a term in a specific field.
Options
-------
......@@ -7,15 +7,18 @@ The options below can be set as query option values, but also by using the set/g
Only the facet-type specific options are listed. See [Facetset component](V3:Facetset_component "wikilink") for the option shared by all facet types.
| Name | Type | Default value | Description |
|----------|---------|---------------|----------------------------------------------------------------------------------------------------------------------------|
| field | string | null | The index field for the facet. |
| sort | string | null | Sort order (sorted by count). Use one of the class constants. |
| limit | int | null | Limit the facet counts |
| offset | int | null | Show facet count starting from this offset |
| mincount | int | null | Minimal term count to be included in facet count results. |
| missing | boolean | null | Also make a count of all document that have no value for the facet field. |
| method | string | null | Use one of the class constants as value. See <http://wiki.apache.org/solr/SimpleFacetParameters#facet.method> for details. |
| Name | Type | Default value | Description |
|--------------------|---------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| field | string | null | The index field for the facet. |
| prefix | string | null | Limit the terms on which to facet to those starting with the given prefix. This does not limit the query, only the facets. |
| contains | string | null | Limit the terms on which to facet to those containing the given substring. This does not limit the query, only the facets. Available since Solr 5.1. |
| containsignorecase | boolean | null | If 'contains' is used, causes case to be ignored when matching the given substring against candidate facet terms. |
| sort | string | null | Sort order (sorted by count). Use one of the class constants. |
| limit | int | null | Limit the facet counts. |
| offset | int | null | Show facet count starting from this offset. |
| mincount | int | null | Minimal term count to be included in facet count results. |
| missing | boolean | null | Also make a count of all document that have no value for the facet field. |
| method | string | null | Use one of the class constants as value. See <http://wiki.apache.org/solr/SimpleFacetParameters#facet.method> for details. |
||
Example
......
The concept of a 'facetset' is doesn't exist in Solr. It was added to Solarium to have one central component for using facets of various type. You can use the facetset to create and manage facets, and also to set global facet options.
The concept of a 'facetset' doesn't exist in Solr. It was added to Solarium to have one central component for using facets of various type. You can use the facetset to create and manage facets, and also to set global facet options.
See the API docs for all methods. In the following sections facet types will be detailed. The examples used on those pages will also show the usage of the facetset component.
Global facet options
--------------------
| Name | Type | Default value | Description |
|----------|---------|---------------|------------------------------------------|
| prefix | string | null | Limit the terms for faceting by a prefix |
| sort | string | null | Set the facet sort order |
| limit | int | null | Set the facet limit |
| mincount | int | null | Set the facet mincount |
| missing | boolean | null | Set the 'count missing' option |
| Name | Type | Default value | Description |
|--------------------|---------|---------------|------------------------------------------------------------------------|
| prefix | string | null | Limit the terms for faceting by a prefix |
| contains | string | null | Limit the terms for faceting by a substring (available since Solr 5.1) |
| containsignorecase | boolean | null | Causes case to be ignored for 'contains' |
| sort | string | null | Set the facet sort order |
| limit | int | null | Set the facet limit |
| mincount | int | null | Set the facet mincount |
| missing | boolean | null | Set the 'count missing' option |
||
Standard facet options
......
......@@ -34,9 +34,7 @@ class Field extends AbstractField implements ExcludeTagsInterface
}
/**
* Limit the terms for faceting by a string they must contain.
*
* This is a global value for all facets in this facetset
* Limit the terms for faceting by a string they must contain. Since Solr 5.1.
*
* @param string $contains
*
......@@ -50,8 +48,6 @@ class Field extends AbstractField implements ExcludeTagsInterface
/**
* Get the facet contains.
*
* This is a global value for all facets in this facetset
*
* @return string
*/
public function getContains()
......@@ -60,9 +56,7 @@ class Field extends AbstractField implements ExcludeTagsInterface
}
/**
* Case sensitivity of matching string that facet terms must contain.
*
* This is a global value for all facets in this facetset
* Case sensitivity of matching string that facet terms must contain. Since Solr 5.1.
*
* @param bool $containsIgnoreCase
*
......@@ -76,8 +70,6 @@ class Field extends AbstractField implements ExcludeTagsInterface
/**
* Get the case sensitivity of facet contains.
*
* This is a global value for all facets in this facetset
*
* @return bool
*/
public function getContainsIgnoreCase()
......
......@@ -117,7 +117,7 @@ class FacetSet extends AbstractComponent implements FacetSetInterface
}
/**
* Limit the terms for faceting by a string they must contain.
* Limit the terms for faceting by a string they must contain. Since Solr 5.1.
*
* This is a global value for all facets in this facetset
*
......@@ -143,7 +143,7 @@ class FacetSet extends AbstractComponent implements FacetSetInterface
}
/**
* Case sensitivity of matching string that facet terms must contain.
* Case sensitivity of matching string that facet terms must contain. Since Solr 5.1.
*
* This is a global value for all facets in this facetset
*
......
......@@ -125,7 +125,7 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
$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", null === ($ignoreCase = $facet->getContainsIgnoreCase()) ? null : ($ignoreCase ? 'true' : 'false'));
$request->addParam("f.$field.facet.contains.ignoreCase", $facet->getContainsIgnoreCase());
$request->addParam("f.$field.facet.offset", $facet->getOffset());
$request->addParam("f.$field.facet.mincount", $facet->getMinCount());
$request->addParam("f.$field.facet.missing", $facet->getMissing());
......
Markdown is supported
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