Hi everyone!
I have a little question for the wizards of Elastic, here... I hope that someone can help me in clarifying if this is an issue that is affecting my logic, or if I've encountered a limitation of the technology.
Here we go:
I have two indexes, named index1 and index2.
In index1 there are 10 fields.
In index2 there are other 10 fields.
of those 10 fields, two of them are shared between the two indexes. So, the data in those two fields are the same across the indexes.
In total I have 20 fields, 4 of them are overlapping.
I have set up an index pattern like "index*", so in Discover I can browse all the data form the two indexes, but if I want to create a visualisation, even a simple table, I'm having this problem:
As long as I choose the overlapping fields in the index, I can "correlate" the info using the overlapping fields as a correlation element, but if I want to put, to say, Field1 from index1 on the X Axis of a chart, and Field2 from index2 on the Y Axis of a chart, if those fields are not the ones overlapping, nothing is visualised.
Hi, welcome to the Elastic community! I'm confused by the question because of the example you gave. If field1 and field2 are on different indices, then there will never be any documents that match your aggregations and you will always get an empty visualization. Is there some other way you're trying to match the documents?
Thank you for your response!
I'm starting to get the problem: Actually, I need something that is similar to the hated JOIN in SQL language, I suppose:
If I have index1 that contains water precipitation for my country, categorised by city, and index2 that contains higher temperatures for my country, categorised by city, I'll have town and country fields overlapping, but the other data will be impossible to aggregate, because they are in different documents. The best that I can do is have two different visualisations in a dashboard that will react when the overlapping fields are filtered, right?
If I don't get wrong, the only way to "join" those two series of data is before ingestion, is that right? there is no way to obtain some kind of "joined" document at runtime, right?
I would definitely start with two different visualizations, like you said. But there are some exceptions. For example:
In the Lens app, your XY charts can contain data from separate indices as long as the values on the X axis share the same name
In the Maps app, you can plot multiple layers and compare against the location- not sure if you actually have geodata, but wanted to mention
You can create a scripted field on your combined index pattern, and the script can do the logic differently depending on the index (not fast, but technically possible)
Thank you Wylie, again.
I'll explore the Lens app better!
...and I completely forgot about the scripted fields. Not my very cup of tea, but those are good ideas. Thank you again!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.