Aggregation on join index

Hi guys,

Is there a way to make aggregation on a related join indices ?

Thanks

Can you give an example of what you’d like to achieve ?

Hi Stephane,

Example:

curl -XGET 'http://localhost:9200/siren/articles/_search?pretty' -d '{
   "query" : {
      "join" : {                      (1)
        "indices" : ["companies"],    (2)
        "on" : ["mentions", "id"],    (3)
        "request" : {                 (4)
          "query" : {
            "term" : {
              "name" : "orient"
            }
          }
        }
      }
    },
    "aggs": {
       "companySiren" : {
            "terms" : { "field" : "companies.siren" } 
        }
    }
}'

I want to get an aggregation based on related field in joined indice.

Is it possible ?

Thanks

@Stephane_Campinas

Have you got a method to achieve my example ?

Thanks

Hi @kalypso63,

Sorry for the late reply.
What you want to achieve is not yet possible, but will be in with the 20 release of Federate. You will be able to access the companies.siren field from a scripted aggregation.

Cheers,

@Stephane_Campinas, we are also facing similar issue - aggregation based on related field in joined indice. Can you please share an example how to add this “scripted aggregation” mentioned above ( You will be able to access the companies.siren field from a scripted aggregation)

Hi @jeffPowers,

This feature is not yet released (will be in 20). I will link to the documentation once it’s out.

Cheers,

Now in Federate 7.6.2-20.0 that you can download at [1] you have the possibility to execute inner joins.

For example, if you have 2 indices Article and Company, you can project of scores from the Article documents to the Company documents, and then base the sorting of companies on the Article's scores.
Another example with 2 indices Company and Investment, you can project the investment made for each company, and compute the sum of investment made per company, i.e., an aggregation.

You can have a look at the DSL at [2].

Cheers,

[1] https://siren.io/downloads/?product=siren-federate
[2] https://docs.siren.io/siren-federate-user-guide/20.0/siren-federate/query-dsl.html#siren-federate-query-dsl-project

Hi Stephane,

We have a 6.8 version for Elastic search. Is it possible to have a siren federate plugin (v20) for this version ?

Cheers

Mickael

Hi,

Unfortunately, this is not possible. Federate 20 is only available for Elasticsearch 7.6.2, 7.7.1 and 7.8.0.