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

107
Views
Error en Elastic Search en Javasctipt - Consulta contra múltiples índices

Cuando ejecuto el siguiente código, estoy ejecutando lo siguiente por error en la búsqueda elástica:

Invalid alias name [...] must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]

No me gusta que esté usando index1,index2 como mi índice (también probé index : [index1, index2]

Este código funciona en Kibana cuando lo ejecuto en la misma fuente de datos.

La dependencia de Elastic Search es "@elastic/elasticsearch": "7.6"

 const { client } = context; // context from graphql resolver const query = buildQuery({ id: id, queryIndex: `${index1},${index2}`; }); const results = await client.search(query); export const buildQuery = ({ id. queryIndex }) => ({ index: queryIndex, body: { query: { bool: { must: [ { terms: { 'someId': [id] } } ] } }, aggs: { byindex: { terms: { field: '_index' }, aggs: { min_date: { min: { field: 'date', format: 'yyyy-MM-dd' } }, max_date: { max: { field: 'date', format: 'yyyy-MM-dd' } } } } } } });
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!