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

174
Vistas
how to do exact match in elastic search?

I want to find exact match .if there is no match .I don't want to null.

I am search this id 6a8c283f-1e75-ec11-8943-000d3a15f525. it is giving me this output

  • fcf0dd4e-abbc-ec11-983f-0022482588e9

But these it is not matched only ec11 matched

I tried this search query

 result = await client.search({
          index: 'products',
          "query": {
            "match": {
              "sysid":sysid
            }
          }
        })
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem is because your sysid field is of type text and is thus analyzed at indexing time and tokenized into fcf0dd4e, abbc, ec11, 8943 and 000d3a15f525.

Also when searching using a match query, the searched term is analyzed as well into the following tokens 6a8c283f, 1e75, ec11, 8943, 000d3a15f525.

As you saw, the match works because ec11 matches.

For an exact match, what you need to do is to run your query against a keyword field instead. Maybe you're lucky and your mapping already contains a sysid.keyword sub-field. If not, you need to change your mapping and reindex your data.

Then you'll be able to run your term query like this and get your exact match:

  "term": {
     "sysid.keyword":sysid
  }
about 4 years ago · Santiago Trujillo Denunciar
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