Skip to end of metadata
Go to start of metadata

Porting Scripts for Advanced Search v5

With Advanced Search version 5 the format of Advanced Search configurations has changed. This is due to the deprecation of the old SearchResultWithExcerpt format that was used in previous versions which has necessitated a move to using the SearchResult interface, which in-turn changes the way that result properties are accessed.

Changes

In previous releases the result bean was exposed as a simple map of data which was accessed using $result.get("fieldname"), and whilst it's possible to use the related $result.getField("fieldname") it is often cleaner to make use of the accessors provided by the SearchResult interface.

Conversion

To convert your scripts to use this new format, replace the values in the scripts as shown below:

 

Old codeNew Code
$result.get("ancestorIds")$result.getField("ancestorIds")
$result.get("authorContributions")$result.getField("authorContributions")
$result.get("commenters")$result.getField("commenters")
$result.get("content-name-unstemmed")$result.getField("content-name-unstemmed")
$result.get("content-name-untokenized")$result.getField("content-name-untokenized")
$result.get("contentBody")$result.content
$result.get("created")$result.getField("created")
$result.get("creationDate")$result.creationDate
$result.get("creatorName")$result.creator
$result.get("handle")$result.handle
$result.get("label")$result.getField("label")
$result.get("labelContributions")$result.getField("labelContributions")
$result.get("labelText")$result.getField("labelText")
$result.get("lastModificationDate")$result.lastModificationDate
$result.get("lastModifierName")$result.lastModifier
$result.get("lasttModifiers")$result.getField("lasttModifiers")
$result.get("linksFrom")$result.getField("linksFrom")
$result.get("linksTo")$result.getField("linksTo")
$result.get("modified")$result.getField("modified")
$result.get("realTitle")$result.getField("realTitle")
$result.get("searchLabel")$result.getField("searchLabel")
$result.get("space")$result.getField("space")
$result.get("space").getName()$result.spaceName
$result.get("space").name$result.spaceName
$result.get("spacekey")$result.spaceKey
$result.get("title")$result.displayTitle
$result.get("type")$result.type
$result.get("urlPath")$result.urlPath
$result.get("version")$result.getField("version")
$result.get("versionComment")$result.getField("versionComment")
$result.get("watchers")$result.getField("watchers")

 

 

  • No labels