I've set up a cluster, but I've created an index to perform semantic searches. When I try to send a request, I always get a timeout. I use @elastic/elasticsearch with NodeJS.
const elastichSearchClient = new Client({
cloud: { id: env.ELASTICSEARCH_CLOUD_ID },
auth: { apiKey: env.ELASTICSEARCH_API_KEY }
})
const dataPrivate = await elastichSearchClient.search({
index: env.ELASTICSEARCH_INDEX_PROFILES,
body: {
query: {
bool: {
must: [
{
semantic: {
field: "profesional_experience",
query: searchText
}
},
{
terms: {
"_id": user_suggested_ids.map(id => id.toString()) // Incluir solo los documentos con estos IDs
}
}
]
}
},
size: count,
_source: ["user_id"] // Solo necesitamos el user_id
}
});
Has anyone had the same problem and been able to solve it?