Multisource filtering


#1

Hi guys, I know ChartFactor supports multi-source interactivity and I’ve seen it working, mostly with the Interaction Manager. However, I’m not able to make it work by myself without it, I mean, we do use the Interaction Manager, but I want to also set filters from somewhere else.

I have two Elasticsearch indexes that have some fields representing the same data, so what I want to do is that when one of the visualizations from one index is filtered, the visualizations from the other index are also filtered. That’s what I was expecting to happen. Do I need to do something else or this feature simply doesn’t work without the Interaction Manager component?


#2

If you want to set filters without the interaction manager (the IM won’t exist in the app), then you’ll need to manually set the filter directly to the visualization with .filters(), .clientFilters() or .staticFilters(). In any case you just need that the filter path matches a field name in the source of that visualization.

In any other case (when the IM is in the app), the filter will be evaluated based on its label. This is what ensures the Multi-source filtering.

If you have two fields that are named differently in two different sources, ie: “name” and “person_name”, but they represent the same data, you just need to set the same label for both of them at metadata level. The IM will know that it’s referring to the same field.

The opposite also happens: Two fields named as the same, let’s say both are stored as “name”, but the one if for persons, the other for institutions, then you will have to label them differently at metadata level to ensure that a filter with path “name” will never be incorrectly applied.

When the filter is applied by clicking a visual, the IM will automatically evaluate that filter to find any equivalent across sources based on the label, and it always respect the rules I explained before.

If instead you are passing the filters yourself straight to the IM (using the IM API), and you have not defined any metadata, then make sure the filter objects passed have the label property (with .label()) to ensure the compatibility, otherwise it will ignore the filter even if the path matches a field name in the datasource.

Hope it helps.


IManager is not correctly filtering the data in the widgets with a different source provider
#3

Let’s say that I have Elasticsearch and Google BigQuery and I want to play with data from both providers at the same time, the multisource filtering will work on them or it is only for different sources under the same provider?


#4

Hi @diego, yes, it works across sources and providers. By following the rules I’ve specified any app can have several visuals from different providers and interact as if they belong to the same.


#5

I have the same provider for both, but different sources, but the other source won’t apply the filter, just the source that belongs to the visual that triggers the filter. I’m not setting the filters manually, just using the Interaction Manager.


#6

According to your description you have some visuals that belongs to one source and some other visuals belonging to a different source right? Your problem seems to be related with the filter label, but since you’re not setting filters manually my guess is that you may have a custom label defined for the field you are using to filter in one of the sources at metadata level. Make sure the same field for both sources is defined in the same way.


#7

Oh I see, so is not only the filter label but the field label as well. For one of the sources I had a label defined in the metadata (honestly I forgot I had this setting) that’s why I missed it.