sinequa / sba-angular

Sinequa's Angular-based Search Based Application (SBA) Framework
https://sinequa.github.io/sba-angular/
MIT License
30 stars 23 forks source link

Parsing of expression from heatmap filtered item not accurate #48

Closed Guillaume-Developer closed 2 years ago

Guillaume-Developer commented 2 years ago

I noticed recently that the breadcrumbs produced for the Heatmap items are not really accurate to what's happening. I think it is the fault of the expression not being parsed correctly due to the filtering being on two columns at once, or maybe the filtering itself is not done correctly?

In the image below, I applied two filters from the Heatmap: "ALCOHOL/United States" and "NICOTINE/United States", which is then transformed into 3 filters for the breadcrumbs. image

Here's how it looks like if we check in the console: image

Here's the expression in the URL: select":[["(geo`United States/ALCOHOL`:`UNITED STATES`) AND (compounds`United States/ALCOHOL`:`ALCOHOL`) AND (`United States/NICOTINE`:(geo:`UNITED STATES` AND compounds:`NICOTINE`))","Heatmap"]]

Here's the expression as a string: text:(geo`United States/ALCOHOL`:`UNITED STATES` AND compounds`United States/ALCOHOL`:`ALCOHOL` AND `United States/NICOTINE`:(geo`United States/NICOTINE`:`UNITED STATES` AND compounds`United States/NICOTINE`:`NICOTINE`))

Furthermore, when we start having more than 2 filters, then the heatmap filters will not be considered as structured filters, because only the 1st and last filters are considered structured (when I say 1st filter, it is considering filter applied, not displayed. So in the display it is geo`United States/ALCOHOL`:`UNITED STATES` AND compounds`United States/ALCOHOL`:`ALCOHOL`).

ericleib commented 2 years ago

Thank you for reporting that! I have 2 questions:

Guillaume-Developer commented 2 years ago
  1. If I select only one item, I think it works fine.

Here's the select from the url: "select":[["`ALCOHOL/United States`:(compounds:`ALCOHOL` AND geo:`UNITED STATES`)","heatmap"]]

Here's how it looks with the breadcrumbs: image

  1. I am using the cross-aggregation mode, I believe. In my Sinequa configuration, the aggregation's column has for value {heatmapField1}/{heatmapField2} where heatmapField1 and heatmapField2 are passed on dynamically in the code.
ericleib commented 2 years ago

FYI we fixed this bug internally, but in fact it's only a display problem, the query executed by the engine is actually correct.

Guillaume-Developer commented 2 years ago

Alright, do you have a lead on how to fix the display then? Are you going to fix that in a future release or should it be fixed by us?

ericleib commented 2 years ago

Yes we fixed it and it will be released in the next version. Fyi the fix consisted in adding a new option to addfiltersearch to avoid merging a breadcrumb with the previous one.