SearchObject Structure - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

API functions manipulate a JavaScript object describing the application state. This object is a subset of the AFS Search webservice parameters that AFS Widgets can handle. The description of that object in JSON Schema notation (draft 4) is given below.

{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
"string-array": {
"type": "array",
"items": {
"type": "string"
}
},
"filter-array": {
"type": "array",
"items": {
"$ref": "#/definitions/filter"
}
},
"filter": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"values"
]
}
},
"properties": {
"channel": {
"type": "string"
},
"feed": {
"type": "string"
},
"keywords": {
"type": "string"
},
"sort": {
"type": "string"
},
"replies": {
"type": "number"
},
"page": {
"type": "number"
},
"cluster": {
"type": "string"
},
"overspill": {
"type": "boolean"
},
"filters": {
"$ref": "#/definitions/filter-array"
},
"orFilters": {
"$ref": "#/definitions/filter-array"
},
"pinnedFacets": {
"$ref": "#/definitions/string-array"
},
"explain": {
"$ref": "#/definitions/string-array"
},
"virtualFields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
]
}
},
"geoDist": {
"type": "object",
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"radius": {
"type": "number"
}
},
"required": [
"latitude",
"longitude",
"radius"
]
},
"others": {
"type": "string"
}
}
}

To help you validate your objects, you can see JSON Schema or use the JSON Schema validator.