Search Response

When a request completes successfully, the response body contains the search results.

When a request returns an error code, the body of the response contains information about the error that occurred. Error responses are always returned in JSON. If an error occurs while the request body is parsed and validated, the error code is set to 400 and the response body includes a list of the errors and where they occurred.

The following example shows a JSON response.

{
    "rank": "-text_relevance",
    "match-expr": "(and 'read' fct_education_level:'9')",
    "hits": {
        "found": 2056,
        "start": 0,
        "hit": [
            {
                "id": "s2375097",
                "data": {
                    "description": [
                       "Standard 1: Acquisition and use of language..."
                    ],
                    "education_level": [
                        "10",
                        "11",
                        "12",
                        "7",
                        "8",
                        "9"
                    ],
                    "jurisdiction": [
                        "Idaho"
                    ]
                }
            }
        ]
    },
    "info": {
        "rid": "9aef9a529c6e9b0b6069cc55e0fc5edebc75e56af4db64baaeb0b26fbfa1095427f01ff2d9b1dd00",
        "time-ms": 11,
        "cpu-time-ms": 0
    }
}

Search Response Properties (JSON)

Property Description
match-expr Shows the match expression constructed from the search parameters.
hits Contains hit statistics (found, start) and a hit array that lists the document ids and data for each hit.
found The total number of hits that match the search request after ASN Search finished processing the match set.
start The index of the first hit returned in this response.
hit An array that lists the item ids and data for each hit.
id The unique identifier for an item.
data A list of returned fields.
facets Contains facet information and facet counts.
FacetFieldName A field for which facets were calculated.
constraints An array of the facet values and counts.
value The facet value being counted.
count The number of hits that contain the facet value in FacetFieldName.
info Contains information about the request processing.
rank Lists the fields that were used to rank the search hits.
rid The encrypted item ID.
time-ms How long it took to process the search request in milliseconds.
cpu-time-ms The CPU time required to process the search request in milliseconds.
messages Contains any warning or error messages returned by the search service. The severity, source, host, code, and message are included for each one.
severity Whether the message is a warning or error.
host The host from which the message originated.
code The warning or error code. The search service returns the following warnings and errors:
  • WildcardTermLimit—more than 2000 terms matched the wildcard in the search request. The number of terms matched was limited to 2000.

  • InvalidFieldOrRankAliasInRankParameter—the specified ranking field could not be found.

  • UnknownFieldInMatchExpression—a field specified in the bq parameter could not be found.

  • IncorrectFieldTypeInMatchExpression—the type specified in the match expression does not match the field type.

  • InvalidMatchExpression—the match expression could not be parsed.

  • UndefinedField—an unknown field was specified in the match expression.

message A description of the warning or error that was returned by the search service.