Skip to main content

Testing your search endpoint

Before running a full evaluation in Releval, it's important to verify that your search endpoint is reachable, authenticated correctly, and returns valid responses. Releval provides a number of ways to do this.

Test in the Releval UI​

On the Endpoints page, the Test button next to any endpoint opens a dialog that sends a request to the endpoint with the saved configuration. You can adjust the headers, body, and query string before sending, then review the response: both the raw payload and the candidates Releval extracted from it.

If the request from Releval is itself malformed (e.g. an invalid candidates mapping), a toast notification surfaces the validation error rather than sending the bad request.

Test endpoint API​

You can test an endpoint programmatically by calling the Test Endpoint API:

Example​

curl -X POST -L "https://${RELEVAL_HOST}/api/v1/endpoints/test" \
-H 'Content-Type: application/json' \
-d '{
"type": "elasticsearch",
"authentication": {
"type": "bearer",
"token": "${TOKEN}"
},
"url": "https://localhost:9200/movies/_search",
"method": "GET",
"body": "{\"query\":{\"match_all\":{}}}",
"query_string": "?size=1",
"headers": {
"content-type": "application/json",
"accept": "application/json",
},
"candidates_mapping": "@"
}'

This sends a test request to your search endpoint via the Releval platform. The response from the search endpoint is returned to the caller, along with a X-Eval-Response HTTP header with the value endpoint to indicate that the response is from the search endpoint.

If there is a problem sending the request via Releval, for example, there is a validation error with the test request, there will be no X-Eval-Response HTTP header in the response. This allows the caller to differentiate between a problem originating from the endpoint, or a problem originating from Releval.

Test existing endpoint API​

You can test an existing endpoint with the Test Endpoint with ID API. This is useful to validate that an existing endpoint still works as expected.

Example​

curl -X POST -L "https://${RELEVAL_HOST}/api/v1/endpoints/${ENDPOINT_ID}/test" \
-H 'Content-Type: application/json' \
-d '{
"body": "{\"query\":{\"match_all\":{}}}",
"query_string": "?size=1",
"headers": {
"content-type": "application/json",
"accept": "application/json",
}
}'