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

259
Views
Habilite la ordenación ascendente y descendente de números que son del tipo de palabra clave (Elasticsearch)

Mi tarea es ordenar los documentos en orden ascendente y descendente, pero el 'número' debe permanecer en el tipo de palabra clave. Leí otras publicaciones sobre un tema similar e intenté agregar un 'número' de tipo entero, pero no tuve éxito y el índice falla. Adjunto la configuración actual en el archivo esMapping.js.

¿Hay alguna manera de arreglar este archivo esMapping.js para que funcione la clasificación ascendente y descendente?

 "settings": { "analysis": { "analyzer": { "document_number_analyzer": { "type": "custom", "tokenizer": "document_number_tokenizer" } }, "tokenizer": { "document_number_tokenizer": { "type": "pattern", "pattern": "-0*([1-9][0-9]*)\/", "group": 1 } }, } }

Cartografía:

 "number": { "type": "keyword", "copy_to": [ "_summary" ], "fields": { "sequenceNumber": { "type": "text", "analyzer": "document_number_analyzer" } } }

EDITAR:

Error después de usar un subcampo entero para ordenar documentos:

 022-05-18 11:33:32.5830 [ERROR] ESIndexerLogger Failed to commit bulk. Errors: index returned 400 _index: adama_gen_ro_importdocument _type: _doc _id: 4c616067-4beb-4484-83cc-7eb9d36eb175 _version: 0 error: Type: mapper_parsing_exception Reason: "failed to parse field [number.sequenceNumber] of type [integer] in document with id '4c616067-4beb-4484-83cc-7eb9d36eb175'. Preview of field's value: 'BS-000011/2022'" CausedBy: "Type: number_format_exception Reason: "For input string: "BS-000011/2022"""
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tu mapeo debe ser así:

 "number": { "type": "keyword", "copy_to": [ "_summary" ], "fields": { "sequenceNumber": { "type": "integer" } } }

Y luego simplemente puede ordenar por número. número de number.sequenceNumber

about 4 years ago · Juan Pablo Isaza Report
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!