Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
elasticsearch js: auth having no effect

I have an app that connects to Elasticsearch. It uses standardized js approach to connecting to our enterprise elasticsearch.

const client = new Client({
    node: 'https://my-domain.com',
    auth: {
        username: 'user',
        password: 'pswd'
    },
    tls: {
        rejectUnauthorized: false,
    }
});

I have two problems. First is, that when I delete the auth (which is required), it has no effect.

The second one is that I'm not getting any results neither way (with or without auth). I need to search all indicies with a special pattern 'az*'. In normal elasticsearch, it is possible, hovewer I can't figure it out how to do it programatically.

Here is mine current code:

const printBody = async () => {
    const body = await client.search({
        index: "az*", //not sure whether this line is ok
        query: {
            match: {
                object: "*TEST*"
            }
        }

    });
    console.log(JSON.stringify(body));
}

This code always prints "". Any ideas how to get a result of a query search?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda