Numeric range facets
|this article applies to Funnelback 15.10 and earlier. In Funnelback 15.12 numeric range faceting is natively supported and discussed in the faceted navigation documentation.|
This article outlines a method of producing faceted navigation for numeric ranges.
For example assume a collection contains a numeric (type 3) metadata field holding the price of the item.
This article will show how to produce facets for preset price ranges (such as $0-99, $100-199, $200+).
The collection must contain numeric metadata for the field that range facets are required for.
It’s not possible to achieve range facets with Funnelback unless you have either assigned a metadata value for each of the given price ranges and have tagged each product accordingly, or you have used some other method to take the product’s price and assign it to a price range (e.g. groovy filter script that reads the value and writes additional metadata at crawl time).
The following method can be used to create ranges to an existing collection, provided the collection contains numeric-type metadata containing the value of the attribute that will be assigned to a range.
The ranges that are produced are static (they are pre-computed so you can’t adjust these ranges with a slider control at search time).
The gscope config file that is produced contains document numbers. When running
-docnum argument must be supplied.
padre-gs can only process
gscope.cfg files with a maximum of 10,000 lines when the gscopes are applied against URLs.
Download the range facets code from GitHub.
range-gscopes.pl file should be placed within a
@workflow folder under the collection’s configuration folder.
ranges.cfg file containing the desired ranges. Steps for configuring the numeric ranges are outlined in the range-gscopes documentation.
Add a command to the collection’s update workflow to run the range-gscopes script. Steps for configuring the workflow command are outlined in the range-gscopes documentation.
Run an update of the collection to ensure the ranges are applied to the collection index.
Edit the collection’s faceted navigation.
Add a new gscope facet and assign an appropriate name (e.g. Price range)
For each applicable range, add a category of type Gscope item, using the gscope number you have defined in your
ranges.cfgand assign an appropriate label.
For the above example you would create a facet (e.g. Price range) then add three category elements. The first would have a name like $0-100 and the Gscope (e.g. 3) field set to 10.
e.g. for the example ranges outlined in the range facets documentation the following gscopes would be appropriate:
Facet name: Price
Source: General scope number item
10 as $0-99
11 as $100-199
12 as $200+
This creates a single facet (Price) containing three categories that correspond to the ranges that were defined in