Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

252
Visualizações
How to aggregate combinations / permutations in elasticsearch

Is there a possibility to aggregate combinations or permutations in elasticsearch of a single field per document?

Example for combinations for 1 row:

keyword_field : ["test", "array", "for", "combinations"]

<-- aggregate -->

[
  [ 'test', 'array' ],
  [ 'test', 'for' ],
  [ 'test', 'combinations' ],
  [ 'array', 'for' ],
  [ 'array', 'combinations' ],
  [ 'for', 'combinations' ]
]

I want to calculate how often words appear together in a document. Therefore I imagine that I need to calculate combinations independend for every single document and later add them together.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You'll need to create a new column with painless script to achieve this.

The script would work per document, but you can aggregate on the resulting column and get the stats you need.

So, you'll need to:

  • use the update_by_query API to update the existing documents with the new columns
  • Or, you could route your incomming documents through an ingest pipeline with the painless code that does this
  • Or, if you'd like to do this for existing and all incomming documents, then you'll need all of above

Note that a scripted field is not going to work, as it does not work with aggregates (last I checked)...

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda