Facet and Field Types

FacetFieldType is a property of the facet indicating the type of field is is associated with. Although this closely resembles the FieldType property for a given field, it is not exactly the same.

FacetFieldType DescriptionDescription
stringthis is the most common facet field type indicating that the data this facet’s field holds is of the alphabetic or the alphanumeric type
numericthis indicates the data held by the corresponding field is purely numeric. Use this for currency and range facets
rangefor textual field values only open range is allowed however for numeric field values, selecting this provides option to have the facet type as an open range/checkbox/linklist/slider
searchthis is a special type of facet which can only be of 3 types - Related Searches, Recent Searches, Search Within
tabthis is a relatively new facet field type used to hold the tab names for the productsexplained below

Tab:

Hawksearch can index both product and content data. Although we often see search results to be products alone, there are times when you would want to link to a page/ news article / blog post or a document.

This provides a challenge in controlling the search behavior. The user expects the search results to be segregated by the item's type.

Tabs are special facets which have a different UI compared to all the other facets. They are used to provide a grouping mechanism in a tabulated manner for various types of search results.

By default, the type of search result item displayed is of the product type - this can be easily configured in the facet settings:

Sample request could be as follows:

{
	"FacetSelections": {
		"it": ["content"]
	},
	"ClientGuid": "YOUR CLIENT GUID HERE",
	"ClientData": {
		"VisitorId": "273a9403-ed2d-4656-85c7-48b5aaf4cf6e",
		"VisitId": "2981c167-cc7c-4c9f-83f9-d733a76c4931",
		"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36",
		"PreviewBuckets": []
	}
}

The output format of a tabulated facet will be as below (notice the fieldtype to be tab):

{
            "FacetId": 83297,
            "Name": "Tabs",
            "Field": "it",
            "FieldType": "tab",
            "FacetType": "checkbox",
            "DataType": "string",
            "DisplayType": "default",
            "MaxCount": 10,
            "MinHitCount": 1,
            "ParamName": "",
            "SortBy": "Custom",
            "ExpandSelection": true,
            "IsNumeric": false,
            "IsCurrency": false,
            "CurrencySymbol": "",
            "IsSearch": false,
            "ScrollHeight": 0,
            "ScrollThreshold": 0,
            "TruncateThreshold": 0,
            "SearchThreshold": 0,
            "AlwaysVisible": true,
            "Tooltip": "",
            "IsCollapsible": false,
            "IsCollapsedDefault": false,
            "SortOrder": 27449,
            "IsVisible": true,
            "NofVisible": 0,
            "Height": 0,
            "SwatchData": [],
            "FacetRangeDisplayType": 0,
            "PreloadChildren": false,
            "ShowSliderInputs": false,
            "Ranges": [],
            "Values": [
                {
                    "Label": "Content",
                    "Value": "content",
                    "Count": 98,
                    "Selected": true,
                    "NoFollow": "true"
                },
                {
                    "Label": "Products",
                    "Value": "item",
                    "Count": 2645,
                    "Selected": false,
                    "NoFollow": "true"
                }
            ],
            "HiddenValues": []
        },

Disambiguation

Field → FieldType

FieldType of a field indicates the storage and indexing methods to be used for the field.

Field → Type

Type of a field is the actual datatype which can be held by the field

Facet → FacetFieldType

This correlates to the Field’s Type attribute however it is not exactly the same. It is the datatype

Facet → FacetType

This related to the way the facet is intended to be displayed on the front end. This is not to be confused with the DisplayType described next. This is dependent on the FacetFieldType property and changes accordingly. Generally, the FacetType options are the same for String, Numeric and Tabs FacetFieldTypes.

Facet → FacetDisplayType

This is an option to further configure the facet’s display - we can:

  • Limit the number of facet values displayed - through truncating display
  • Pack large number of facet values into a smaller area - through scrolling display

Note: This depends on the FacetType. For range facets, this doesn’t apply. For nested facets, scrolling doesn’t apply

Possible Configurations

Field.FieldTypeField.TypeFacet.FacetFieldTypeFacet.FacetTypeFacet.DisplayType
facetBooleanrangecheckboxdefault
facetBooleanstringcheckboxdefault
facetBooleanstringcheckboxscrolling
facetBooleanstringlinkdefault
facetDatetimerangecheckboxdefault
facetDatetimerangelinkdefault
facetDatetimerangeopenRangedefault
facetDatetimerangesliderdefault
facetGeoPointrangecheckboxdefault
facetNULLrangesliderscrolling
facetNULLstringcheckboxdefault
facetNULLstringcheckboxscrolling
facetNULLstringcheckboxtruncating
facetSinglenumericcheckboxdefault
facetSinglenumericcheckboxscrolling
facetSinglenumericcheckboxtruncating
facetSinglenumericratingdefault
facetSinglenumericsliderdefault
facetSinglerangecheckboxdefault
facetSinglerangecheckboxscrolling
facetSinglerangecheckboxtruncating
facetSinglerangelinkdefault
facetSinglerangelinkscrolling
facetSinglerangeopenRangedefault
facetSinglerangesliderdefault
facetSinglerangesliderscrolling
facetSinglerangeslidertruncating
facetSinglestringcheckboxdefault
facetSinglestringcheckboxscrolling
facetSinglestringcheckboxtruncating
facetSinglestringlinkscrolling
facetSinglestringratingdefault
facetSinglestringratingscrolling
facetStringnumericcheckboxdefault
facetStringnumericcheckboxtruncating
facetStringrangecheckboxdefault
facetStringrangecheckboxscrolling
facetStringrangecheckboxtruncating
facetStringrangelinkdefault
facetStringrangelinkscrolling
facetStringrangeopenRangedefault
facetStringrangerecentsearches2default
facetStringsearchsearchdefault
facetStringstringcheckboxdefault
facetStringstringcheckboxscrolling
facetStringstringcheckboxtruncating
facetStringstringCheckbox listText
facetStringstringlinkdefault
facetStringstringlinkscrolling
facetStringstringlinktruncating
facetStringstringnestedcheckboxdefault
facetStringstringnestedcheckboxscrolling
facetStringstringnestedcheckboxtruncating
facetStringstringnestedlinklistdefault
facetStringstringnestedlinklisttruncating
facetStringstringratingdefault
facetStringstringratingscrolling
facetStringstringratingtruncating
facetStringstringsizedefault
facetStringstringsizescrolling
facetStringstringsizetruncating
facetStringstringswatchdefault
facetStringstringswatchscrolling
facetStringstringswatchtruncating
facetStringtabcheckboxdefault
facetStringtablinkdefault
keywordBooleannumericcheckboxdefault
keywordBooleanstringcheckboxdefault
keywordDatetimerangesliderdefault
keywordSinglenumericcheckboxdefault
keywordSinglenumericcheckboxtruncating
keywordSinglenumericsliderdefault
keywordSinglerangecheckboxdefault
keywordSinglerangecheckboxscrolling
keywordSinglerangelinkscrolling
keywordSinglerangesliderdefault
keywordSinglestringcheckboxdefault
keywordSinglestringcheckboxscrolling
keywordSinglestringratingdefault
keywordStringstringcheckboxdefault
keywordStringstringcheckboxscrolling
keywordStringstringcheckboxtruncating
keywordStringstringlinkscrolling
keywordStringstringnestedcheckboxdefault
keywordStringstringnestedcheckboxscrolling
keywordStringstringnestedcheckboxtruncating
keywordStringstringsizedefault
keywordStringstringsizescrolling
keywordStringtabcheckboxdefault
textStringstringcheckboxscrolling
textStringstringlinkscrolling
unindexedStringstringcheckboxdefault
unindexedStringstringcheckboxscrolling