Get the query rewrite status
import requests
url = "https://{FUSION_HOST}/api/query-rewrite/{type}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://{FUSION_HOST}/api/query-rewrite/{type}")
.header("Authorization", "Basic <encoded-value>")
.asString();const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://{FUSION_HOST}/api/query-rewrite/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/query-rewrite/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/query-rewrite/{type}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/query-rewrite/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://{FUSION_HOST}/api/query-rewrite/{type} \
--header 'Authorization: Basic <encoded-value>'{
"app": "<string>",
"type": "<string>",
"enabled": true,
"numDeployed": 123,
"collection": "<string>",
"job": "<string>",
"lastDeployedOn": "2023-11-07T05:31:56Z",
"lastJobStatus": {
"resource": "`spark:api-test-app_synonym_detection`",
"runId": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"status": "<string>",
"error": {},
"extra": {},
"startedBy": "<string>"
}
}Get the query rewrite status
Check the status of any instances of a specific query rewrite type, such as rules or spell correction.
GET
/
query-rewrite
/
{type}
Get the query rewrite status
import requests
url = "https://{FUSION_HOST}/api/query-rewrite/{type}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://{FUSION_HOST}/api/query-rewrite/{type}")
.header("Authorization", "Basic <encoded-value>")
.asString();const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://{FUSION_HOST}/api/query-rewrite/{type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}/api/query-rewrite/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}/api/query-rewrite/{type}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION_HOST}/api/query-rewrite/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request GET \
--url https://{FUSION_HOST}/api/query-rewrite/{type} \
--header 'Authorization: Basic <encoded-value>'{
"app": "<string>",
"type": "<string>",
"enabled": true,
"numDeployed": 123,
"collection": "<string>",
"job": "<string>",
"lastDeployedOn": "2023-11-07T05:31:56Z",
"lastJobStatus": {
"resource": "`spark:api-test-app_synonym_detection`",
"runId": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"status": "<string>",
"error": {},
"extra": {},
"startedBy": "<string>"
}
}Authorizations
Basic authAPI key
Path Parameters
The query rewrite type. Use /query-rewrite/instances to get the types for your existing query rewrites, or /query-rewrite/schema to get all possible types.
In the Fusion UI, some of these types correspond to the rewrite types in the Rewrites Manager and others correspond to action types in the Rules Manager.
Query Parameters
Response
200 - application/json
OK
Was this page helpful?