NOTE: The recommended way to use facet refinement is to use the token
string. Each FacetResult will have a token that is acceptable instead of this
class. To provide manual FacetRefinement, an instance of this class can be
passed to SearchOptions.
NOTE: that either value or facet_range should be set but not both.
Example: Request for a range refinement for a numeric facet:
FacetRefinement(name='rating', facet_range=FacetRange(start=1.0,end=2.5))
Args
name
The name of the facet.
value
Value of the facet.
facet_range
A FacetRange to refine facet based on a range.
Raises
TypeError
If any of the parameters have invalid types, or an unknown
attribute is passed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-04-26 UTC."],[[["`FacetRefinement` is used to filter search results based on a specific facet value or range, providing a way to narrow down search outcomes."],["The recommended way to use `FacetRefinement` is through the `token_string` provided with each `FacetResult`, instead of manual creation."],["`FacetRefinement` can be created manually by specifying the facet `name`, either a `value`, or a `facet_range`, but not both simultaneously."],["The `FromTokenString` method converts a `token_string` into a `FacetRefinement` object, facilitating the use of token strings obtained from search results."],["The `ToTokenString` method converts a given refinement into a `token_string` safe to use in HTML."]]],[]]