Hi,
Iam Trying to access the data from the database in my cloud function using the belwo code , but iam getting index error, i have made the column as searchable when creating the database.Kindly do the needful
Code:
let data = app.dataStore.search({
table: “test”,
body : {
"query" : {
"match" : {
"IDSTRINGVAL":"12312312asdasd"
}
}}
});
Error:rror in datastore retry search : tablename : test : traceId : 5325322271019950423211101605_CXLqSlnHwc7Rbav1oDXrx {
success: false,
message: ‘Failure’,
data: {
error: {
msg: ‘[index_not_found_exception] no such index [x1632228414688_test], with { resource.type=“index_or_alias” & resource.id=“x1632228414688_test” & index_uuid=“na” & index=“x1632228414688_test” }’,
path: ‘/x1632228414688_test/_search’,
query: {},
body: ‘{“query”:{“match”:{“IDSTRINGVAL”:“12312312asdasd”}}}’,
statusCode: 404,
response: ‘{“error”:{“root_cause”:[{“type”:“index_not_found_exception”,“reason”:“no such index [x1632228414688_test]”,“resource.type”:“index_or_alias”,“resource.id”:“x1632228414688_test”,“index_uuid”:“na”,“index”:“x1632228414688_test”}],“type”:“index_not_found_exception”,“reason”:“no such index [x1632228414688_test]”,“resource.type”:“index_or_alias”,“resource.id”:“x1632228414688_test”,“index_uuid”:“na”,“index”:“x1632228414688_test”},“status”:404}’
}
},
subscriptionExceeded: false
}
Datastore failed: search Response after retries tablename : test : traceId : 5325322271019950423211101605_CXLqSlnHwc7Rbav1oDXrx :: Error: {“error”:{“msg”:"[index_not_found_exception] no such index [x1632228414688_test], with { resource.type=“index_or_alias” & resource.id=“x1632228414688_test” & index_uuid=“na” & index=“x1632228414688_test” }",“path”:"/x1632228414688_test/_search",“query”:{},“body”:"{“query”:{“match”:{“IDSTRINGVAL”:“12312312asdasd”}}}",“statusCode”:404,“response”:"{“error”:{“root_cause”:[{“type”:“index_not_found_exception”,“reason”:“no such index [x1632228414688_test]”,“resource.type”:“index_or_alias”,“resource.id”:“x1632228414688_test”,“index_uuid”:“na”,“index”:“x1632228414688_test”}],“type”:“index_not_found_exception”,“reason”:“no such index [x1632228414688_test]”,“resource.type”:“index_or_alias”,“resource.id”:“x1632228414688_test”,“index_uuid”:“na”,“index”:“x1632228414688_test”},“status”:404}"}}
at /app/models/datastore.js:47:35
at processImmediate (internal/timers.js:464:21)
From previous event:
at axiosDataRetryWrapper (/app/models/datastore.js:39:8)
at DataStore.search (/app/models/datastore.js:123:16)
at eval (eval at (/app/app.js:912:69), :40:27)
From previous event:
at Object.sendCardData (eval at (/app/app.js:912:69), :3:8)
at /app/models/library.js:2508:57
From previous event:
at App.functionWrapper (/app/models/library.js:2503:12)
at App.executeFunction (/app/models/library.js:2375:27)
at App.executeFunction (/app/models/utils/utilFunctions.js:146:26)
at executeNormalAction (/app/components/builder/nextStep.js:509:15)
at executeStepActionNode (/app/components/builder/nextStep.js:865:27)
at nextExecutableStepNewBuilder (/app/components/builder/nextStep.js:917:22)
at executeNewBuilder (/app/components/builder/nextStep.js:1002:34)
at nextStep (/app/components/builder/nextStep.js:1166:11)
at /app/models/library.js:897:13
From previous event:
at afterPostValidation (/app/models/library.js:894:18)
at performAction (/app/models/library.js:1327:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5) undefined