Data model changes in Funnelback v16

When Funnelback 16 was released a number of deprecated data model elements were removed from the data model. This guide summarizes the removed elements and provides advice on how to update your integrations with Funnelback.

Removed elements summary

Element Note

question.collection.configuration

Global/server configuration elements are no longer available.

question.rawInputParameters

Use new inputParameters element

question.inputParameterMap

Use new inputParameters element

response.resultPacket.bestBets

Legacy best bets feature, removed in v15.0. Upgrade to use the curator-based best bets.

response.resultPacket.results[].metaData

Use the response.resultPacket.results[].listMetadata element

response.resultsWithTierBars

Use the response.results element instead

response.facets[].categories[].values[].queryStringParam

Legacy faceted navigation

response.facets[].categories[].values[].queryStringParamName

Legacy faceted navigation

response.facets[].categories[].values[].queryStringParamValue

Legacy faceted navigation

response.facets[].categories[].values[].constraint

Legacy faceted navigation

Updating your integration with removed elements

The advice below outlines the steps you can take to upgrade any integration with the commonly used elements that have been removed.

Input parameter elements

Funnelback 15 had two elements that were used to handle input elements. This consisted of

  • question.inputParameterMap which held a single string value for each input parameter. If there were multiple values then the input parameter map only provided access to the first value. This was commonly used for simple request parameters as the code required to access the value was simpler.

  • question.rawInputParameters which held an array of single string values for each input parameter. This element needed to be accessed if you required access to an element that may contain multiple values. This key is equivalent to the new question.inputParameters element.

Funnelback 16 consolidates these two elements into a single question.inputParameters element.

question.inputParameterMap

The deprecated question.inputParameterMap element is a map of request parameters to a single string value.

e.g. question.inputParameterMap["collection"]="example-collection-id"

In v16 this must be replaced with a reference similar to: question.inputParameters["collection"][0]="example-collection-id"

Table 1. Groovy upgrade examples: inputParameterMapinputParameters
v15 inputParameterMap v16 inputParameters

.inputParameterMap != null

.inputParameters != null

.inputParameterMap["sort"] == null

! .inputParameters.containsKey("sort")

.inputParameterMap["sort"] != null

.inputParameters.containsKey("sort")

.inputParameterMap["sort"] == ""

.inputParameters.get("sort")[0] == ""

.inputParameterMap["sort"] != ""

.inputParameters.get('sort')[0] != ''

.inputParameterMap['foo']?.equals("bar")

.inputParameters.get('foo')[0]?.equals("bar")

.inputParameterMap["foo"] = "bar"

.inputParameters.get("foo")[0] = "bar"

.inputParameterMap.remove(key)

.inputParameters.removeAll(key)

.inputParameterMap.meta_R

.inputParameters.get("meta_R")[0]

Table 2. Freemarker upgrade examples: inputParameterMapinputParameters
v15 inputParameterMap v16 inputParameters

inputParameterMap["example"]

inputParameters["example"]?first

question.rawInputParameters

The deprecated question.rawInputParameters element is a map of request parameters to a list of string values.

e.g. question.rawInputParameters["collection"]=["example-collection-id"]

In v16 this must be replaced with a reference similar to: question.inputParameters["collection"]=["example-collection-id"]

Table 3. Groovy upgrade examples: rawInputParametersinputParameters
v15 rawInputParameters v16 inputParameters

.rawInputParameters != null

.inputParameters != null

.rawInputParameters["facetScope"] == null

! .inputParameters.containsKey("facetScope")

.rawInputParameters["facetScope"] != null

.inputParameters.containsKey("facetScope")

.rawInputParameters.containsKey('meta_R')

.inputParameters.containsKey('meta_R')

.rawInputParameters.remove('facetScope')

.inputParameters.removeAll('facetScope')

.rawInputParameters['sort'] = ["metaa"]

.inputParameters.putAll('sort', ["metaa"])

.rawInputParameters["facetScope"]

.inputParameters.get("facetScope")

.rawInputParameters["facetScope"][0]

.inputParameters.get("facetScope")[0]

Table 4. Freemarker upgrade examples: rawInputParametersinputParameters
v15 rawInputParameters v16 inputParameters

rawInputParameters["example"][0]

inputParameters["example"][0]

<#list rawInputParameters["example"] as p>

<#list inputParameters["example"] as p>

Result metadata element

The deprecated metaData element was a sub-element for each result item in v15. This element co-existed alongside a listMetadata element in v15.

Both fields contain the same set of values, however the deprecated metaData element concatenated the set of values into a single string value using a vertical bar character as the delimiter. The listMetadata provides the set of values as a list of strings which you can iterate over.

In v16 you only have access to the listMetadata element.

Table 5. Groovy upgrade examples: metaDatalistMetadata
v15 metaData v16 listMetadata

if(.metaData["contentType"])

if(.listMetadata.get("contentType")[0])

.metaData["contentType"] != null

.listMetadata.get("contentType")[0] != null

.metaData["e"] == null

.listMetadata.get('e')[0] == null

.metaData["e"] == ""

.listMetadata.get('e')[0] == ""

.metaData["1"] = "Detailed data"

.listMetadata.get("1")[0] = "Detailed data"

.metaData.put("curtinId",id)

.listMetadata.put("curtinId",id)

.metaData["contentType"]

.listMetadata.get("contentType")[0]

.metaData.applicationStartDate

.listMetadata.get("applicationStartDate")[0]

Table 6. Freemarker upgrade examples: metaDatalistMetadata
v15 metaData v16 listMetadata

metaData["example"]

listMetadata["example"]?first

<#list metaData["example"]?split("|") as m>

<#list listMetadata["example"] as m>

Legacy faceted navigation elements

The removed legacy faceted navigation elements are all redundant elements that combine data from other elements. We recommend that you update your integration to use these other elements if possible.

However, a plugin that regenerates the removed queryStringParam, queryStringParamName and queryStringParamValue elements as custom data elements can be used if you only have limited capacity to update your integration. Using this plugin still requires changes to your integration to update to using the new field locations, but doesn’t require you to build the elements yourself.