How to visualise the division between the result of two aggregation in Kibana (metrics) - visualization

I'm using kibana 6.8.1-oss and I'd like to visualise the result of the division between two aggregation.
To be more specific, I have a field A and a field B.
I want to create the result of sum(A)/sum(B) in a visualisation so I can put it into a dashboard.
Do you know if it's possible ?
Thanks in advance,

After a some research, I figured that this functionality is yet not supported by Kibana.

Related

What is the equivalent to Postgres's ## to_tsquery(:searchQuery) in ElasticSearch?

We've migrated from a postgres database that was using vectors and using ## to_tsquery(:searchQuery) to perform queries. We are now using ElasticSearch and having a hard time getting the same accuracy that we saw with Postgres Vector searching.
For example we have the phrase "deadpool vs carnage" as the value for a title field on a document and would like this document to come back when performing a search with a query value of "dead carn".
When using postgres this wasn't a problem. But with ElasticSearch I'm unable to get this to return correctly.
I've tried different variations of all the match queries and can't get this to work. Any help would be very much appreciated
Elasticsearch is such a robust system that often times, like with many things, it's easy to overlook the simplest solution.
I ended up using the query_string search with wildcards in the string to achieve this.
You can pass in a query value of dead* carn*.
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

Using Aggregations in RestHeart

I am trying to use the aggregations feature in RestHeart which is described here: https://restheart.org/docs/aggregations/
I am using it to filter and group stuff in my collection based on a input variable, like this.
https://.../_aggrs/test-pipeline?avars={"country":"DE"}
As the documentation states querying the aggregation does not yield the result directly, but I have to query the newly created collection. I found out that it also works to just query the aggregation endpoint twice. But in any case I have to make two requests to get the result.
I am now worried about concurrent users. If two users are querying the aggregation at the same time (with different avars), one might get the result of the other.
I am wondering why this is not mentioned anywhere. It seems to me that everybody should have this problem when using variables (avars) in an aggregation.
How can I solve this? Might transactions be the solution? https://restheart.org/docs/transactions/
I cannot try it right now, because my mongoDB is refusing to start a transaction. But would it even work?
Are there any other solutions?
Best regards,
Tobi

MongoDB Data Transformation for UI display

We've stumbled into a huge issue, which we need to figure out how to achieve in a right manner.
We are using MongoDB via Mongoose and dump a lot of different data.
We need to create a big aggregation from few collections based on certain inputs.
Creating an aggregation function doesn't supply good performance times.
We need to find a technical solution, the correct one,
To actually create "ETL" but no a real ETL, to store a real time sample of the data, so UI layer could query it smoothly.
Let's say i have 5 collections, which i need a real time display of 3 fields of each, and "join" using aggregation won't supply a good enough performance wise solution.
We might need a mediator, we thought dumping data using etl to redshift but it doesn't feel like the right solution.
It seems like a common problem, but we don't seem to find the smooth and correct solution.
We don't mind deploying whatever needed.
Thanks for any advice.

Saving common aggregations in MongoDB

Say I have a Mongo aggregation I know that I will use frequently, for example, finding the average of a dataset.
Essentially, I want someone to make an API for the database such that someone could type db.collection.average() in the mongo shell and get the result of that function, so that someone without much knowledge of the aggregation framework would easily be able to get the average (or result of any complicated aggregation function I create). What is the best way to achieve this?
As of MongoDB 3.4, you can create views that wrap a defined aggregation pipeline. Sounds like a perfect fit for your use case.

OrientDB: connected components OSQL query

Does anybody know how to compute the connected components of a graph with an OrientDB query?
I'm trying to replicate what was done here but I'm missing something similar to a REDUCE operator for collections.
Thanks in advance.
This query
SELECT distinct(traversedElement(0))
FROM (TRAVERSE both('ManagedBy') FROM Employee)
Returned me the right result. At the beginning I could not understand why but then I figured out that the default strategy used in TRAVERSE is DFS that's why we can rely on taking the first node of each traversal as a representative for its connected component.