editSettings
Deleting a Recommend rule is asynchronous.
When you delete a rule, a task is created on a queue and completed depending on the load on the server.
The API response includes a task ID that you can use to check the status.
Usage
// Initialize the client
var client = new RecommendClient(
new RecommendConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);
// Call the API
var response = await client.GetRecommendStatusAsync(
"<YOUR_INDEX_NAME>",
Enum.Parse<RecommendModels>("RelatedProducts"),
12345L
);
// print the response
Console.WriteLine(response);
// Initialize the client
final client = RecommendClient(
appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');
// Call the API
final response = await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.fromJson("related-products"),
taskID: 12345,
);
// print the response
print(response);
// Initialize the client
client, err := recommend.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
// Call the API
response, err := client.GetRecommendStatus(client.NewApiGetRecommendStatusRequest(
"<YOUR_INDEX_NAME>", recommend.RecommendModels("related-products"), 12345))
if err != nil {
// handle the eventual error
panic(err)
}
// print the response
print(response)
// Initialize the client
RecommendClient client = new RecommendClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
// Call the API
GetRecommendTaskResponse response = client.getRecommendStatus("<YOUR_INDEX_NAME>", RecommendModels.RELATED_PRODUCTS, 12345L);
// print the response
System.out.println(response);
// Initialize the client
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initRecommend();
// Call the API
const response = await client.getRecommendStatus({
indexName: 'indexName',
model: 'related-products',
taskID: 12345,
});
// print the response
console.log(response);
// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
var response =
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.entries.first { it.value == "related-products" },
taskID = 12345L,
)
// print the response
println(response)
// Initialize the client
$client = RecommendClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
// Call the API
$response = $client->getRecommendStatus(
'<YOUR_INDEX_NAME>',
'related-products',
12345,
);
// print the response
var_dump($response);
# Initialize the client
# In an asynchronous context, you can use RecommendClient instead, which exposes the exact same methods.
client = RecommendClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status(
index_name="<YOUR_INDEX_NAME>",
model="related-products",
task_id=12345,
)
# print the response
print(response)
# Initialize the client
client = Algolia::RecommendClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
# Call the API
response = client.get_recommend_status("<YOUR_INDEX_NAME>", "related-products", 12345)
# print the response
puts(response)
// Initialize the client
val client = RecommendClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
// Call the API
val response = Await.result(
client.getRecommendStatus(
indexName = "<YOUR_INDEX_NAME>",
model = RecommendModels.withName("related-products"),
taskID = 12345L
),
Duration(100, "sec")
)
// print the response
println(response)
// Initialize the client
let client = try RecommendClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY")
// Call the API
let response = try await client.getRecommendStatus(
indexName: "<YOUR_INDEX_NAME>",
model: RecommendModels.relatedProducts,
taskID: Int64(12345)
)
// print the response
print(response)
See the full API reference
For more details about input parameters
and response fields.