Ingest data and. fetch data through groovy in the. URL https://testsearch-cca1f6.ent.us-central1.gcp.cloud.es.io

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: `);
});

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.