Search lifecycle - data model variable initialization

The elements of the data model are initialized at different phases of the search lifecycle. Understanding when elements are initialized is important when writing custom search lifecycle logic. e.g. If you try to modify a value before it’s initialized you might get an error that the element doesn’t exist, or it might get overridden when the value is initialized.

Search question

The search question object is initialized during the first three phases of the search lifecycle. Modifications to the search question can be manipulated in the following pre-phase steps:

  • Pre process

  • Pre data fetch

Initialize data model phase

The following elements are initialized during the initialize data model phase:

  • question.inputParameters

  • question.additionalParameters

  • question.environmentVariables

  • question.collection

  • question.profile

  • lang related elements

  • question.location

These are all populated for the pre process step.

Input processing phase

The following data model elements are populated after the pre process step. Most of these elements will be setup based on the raw input parameters.

  • session

  • question.userKeys

  • faceted navigation related elements

  • question.metaParameters

  • question.systemMetaParameters

  • curator related elements

  • quick links related elements

  • explore related elements

  • extra search elements

The pre data fetch step executes just before the query is passed to padre for query processing. This can modify the final state of the search question.

Search response

Results fetching phase

The result packet element of the response is initialized from the XML returned by the query processor. Note: that some sub-elements are modified or populated during the output processing phase.

  • response.resultPacket

The post data fetch step can be used to modify the information returned by the query processor and should be used to change anything that is then used during output processing.

Output processing phase

The output processing phase initializes a number of modern UI related features including faceted navigation, curator and the search sessions and history.

The following is initialized during output processing:

  • search result links (click, cache, final live and display links)

  • curator related items

  • HTML encoded summaries

  • extra search responses

  • related document elements

  • faceted navigation elements

  • translations

  • search history

The post processing step executes allowing modification of the final data model.

Results rendering phase

The results rendering phase applies Freemarker templating to the final data model to render the search results as HTML or another format as defined by the Freemarker template.

Display-time modifications can be made within the Freemarker template.