Hey everyone, I want to ingest data dynamically though groovy and search through jquery .
While i was testing the search api, I found some issue related to cors.
Could someone help me out with the following code.
var ElasticAppSearch = window.ElasticAppSearch;
var client = ElasticAppSearch.createClient({
searchKey: "search-qh41tgbe995ibx1bm8qzbh4e",
endpointBase: "https://testsearch-cca1f6.kb.us-central1.gcp.cloud.es.io",
engineName: "PA-SEARCH-ENGINE"
});
var options = {
search_fields: { name: {} },
result_fields: { id: { raw: {} }, title: { raw: {} } },
};
client.multiSearch([{ query: "Bisected", options }, { query: "Bisected", options }])
.then(allResults => {
allResults.forEach(resultList => {
resultList.results.forEach(result => {
console.log("Success");
});
});
})
.catch(error => {
console.log(`error: `);
});