How can I perform an aggregation on multiple fields?

albert muller

How can I perform an aggregation on multiple fields? That is I would like to list out the results of a terms aggregation on "field1" and "field2", not separately, but in the same bucket. Is it possible in elasticsearch?

Vineeth Mohan

As of now there is no direct way to do multi field aggregation in Elasticsearch. But you can achieve the required results using scripts as below:

{  
    "aggs": {    
        "mixed_aggs": {      
            "terms": {        
                "script": "doc['field1'].values + doc['field2'].values"      
            }    
        }  
    }
}

You can read more about the above case in this blog

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How can I make this kind of aggregation in pandas?

From Dev

How can I perform calculation in Javascript

From Dev

How i can use aggregation in django

From Dev

How can I use lodash/underscore to sort by multiple nested fields?

From Dev

How can I use Golang structs to perform CRUD in an API when some fields are readonly and others are nullable?

From Dev

RethinkDB: How can I perform several aggregation operations by running only one query?

From Dev

How Can I Perform $('.div a') in Vanilla JavaScript?

From Dev

How do I perform Aggregation over the column qualifier field in Accumulo?

From Dev

How can I perform the handler of a UIAlertAction?

From Dev

How can I update multiple XML fields with MSSQL?

From Dev

How can I sort by multiple fields in mongodb with Perl?

From Dev

How can I perform an ordered merge with RxJava?

From Dev

How can I set multiple fields as primary key in MongoDB?

From Dev

Elasticsearch how count values from multiple document fields using aggregation

From Dev

How can I perform efficient Deletions in Accumulo across multiple ranges?

From Dev

How can I perform an Array Slice in Swift?

From Dev

How can I perform nested "joins" (joining 3 or more collections) in a MongoDB aggregation pipeline?

From Dev

How i can use aggregation in django

From Dev

MongoDB: How can I order by distance considering multiple fields?

From Dev

RethinkDB: How can I perform several aggregation operations by running only one query?

From Dev

How do I perform django admin actions on text fields with choices?

From Dev

How can I sort by multiple fields in mongodb with Perl?

From Dev

iOS how can i perform multiple NSInputStream

From Dev

Elasticsearch how count values from multiple document fields using aggregation

From Dev

How can I perform this join on a table with multiple records per key without returning multiple records per key?

From Dev

How can I populate the following objects in multiple input fields?

From Dev

How can I parse one field into multiple fields in the same table?

From Dev

How many Amazon SQS ReceiveMessageRequest i can perform on single sqs queue using multiple consumer

From Dev

Aggregation - Unwind multiple fields

Related Related

  1. 1

    How can I make this kind of aggregation in pandas?

  2. 2

    How can I perform calculation in Javascript

  3. 3

    How i can use aggregation in django

  4. 4

    How can I use lodash/underscore to sort by multiple nested fields?

  5. 5

    How can I use Golang structs to perform CRUD in an API when some fields are readonly and others are nullable?

  6. 6

    RethinkDB: How can I perform several aggregation operations by running only one query?

  7. 7

    How Can I Perform $('.div a') in Vanilla JavaScript?

  8. 8

    How do I perform Aggregation over the column qualifier field in Accumulo?

  9. 9

    How can I perform the handler of a UIAlertAction?

  10. 10

    How can I update multiple XML fields with MSSQL?

  11. 11

    How can I sort by multiple fields in mongodb with Perl?

  12. 12

    How can I perform an ordered merge with RxJava?

  13. 13

    How can I set multiple fields as primary key in MongoDB?

  14. 14

    Elasticsearch how count values from multiple document fields using aggregation

  15. 15

    How can I perform efficient Deletions in Accumulo across multiple ranges?

  16. 16

    How can I perform an Array Slice in Swift?

  17. 17

    How can I perform nested "joins" (joining 3 or more collections) in a MongoDB aggregation pipeline?

  18. 18

    How i can use aggregation in django

  19. 19

    MongoDB: How can I order by distance considering multiple fields?

  20. 20

    RethinkDB: How can I perform several aggregation operations by running only one query?

  21. 21

    How do I perform django admin actions on text fields with choices?

  22. 22

    How can I sort by multiple fields in mongodb with Perl?

  23. 23

    iOS how can i perform multiple NSInputStream

  24. 24

    Elasticsearch how count values from multiple document fields using aggregation

  25. 25

    How can I perform this join on a table with multiple records per key without returning multiple records per key?

  26. 26

    How can I populate the following objects in multiple input fields?

  27. 27

    How can I parse one field into multiple fields in the same table?

  28. 28

    How many Amazon SQS ReceiveMessageRequest i can perform on single sqs queue using multiple consumer

  29. 29

    Aggregation - Unwind multiple fields

HotTag

Archive