Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
I am trying to implement elastic search with firebase cloud functions

Here is my code:

const functions = require("firebase-functions");
const admin = require("firebase-admin");
const {Client} = require("@elastic/elasticsearch");

admin.initializeApp(functions.config().firebase);

const env = functions.config();

const auth = {
  username: env.elasticsearch.username,
  password: env.elasticsearch.password,
};

const client = new Client({
  node: env.elasticsearch.url,
  auth: auth,
});

exports.createTest = functions.firestore
    .document("tests/{testId}")
    .onCreate( async (snap, context) => {
        await client.index({
            index: "temp",
            type: "_doc",
            id: snap.id,
            body: snap.data(),
        })
    });

but I am getting the following error.

createTest
ResponseError: {"statusCode":404,"error":"Not Found","message":"Not Found"} at SniffingTransport.request (/workspace/node_modules/@elastic/transport/lib/Transport.js:476:27) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Client.IndexApi [as index] (/workspace/node_modules/@elastic/elasticsearch/lib/api/api/index.js:51:12) at async /workspace/index.js:22:9
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!