Skip to content

Commit

Permalink
'#2163 Creates a map to store the correspondence between a query escaped
Browse files Browse the repository at this point in the history
name of the field and its original name, that needs to be recovered when
restoring defined filters.
  • Loading branch information
patrickdalla committed Jun 5, 2024
1 parent b77a2f4 commit 3434d2d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class TableHeaderFilterManager implements IResultSetFilterer, IQueryFilte

// store the filters defined by the FieldValuePopupMenu
private HashMap<String, String> otherFilters = new HashMap<String, String>();
private HashMap<String, String> escapedFields = new HashMap<String, String>();

static public TableHeaderFilterManager get() {
return singleton;
Expand Down Expand Up @@ -189,7 +190,9 @@ public MetadataSearch getMetadataSearch(String field) {
MetadataSearch result = panels.get(field);
if (result == null) {
result = new MetadataSearch();
panels.put(field, result);
String escapedField = escape(field);
panels.put(escapedField, result);
escapedFields.put(escapedField, field);
}
return result;
}
Expand Down Expand Up @@ -271,12 +274,12 @@ public IMultiSearchResult filterResult(IMultiSearchResult src) throws ParseExcep
for (String filterField : panels.keySet()) {
MetadataSearch internalMetadataSearch = panels.get(filterField);
Set<Integer> ords = new HashSet<>();
Set<ValueCount> values = selectedValues.get(escape(filterField));
Set<ValueCount> values = selectedValues.get(filterField);
if (values != null && values.size() > 0) {
for (ValueCount value : values) {
ords.add(value.getOrd());
}
result = internalMetadataSearch.getIdsWithOrd(result, filterField, ords);
result = internalMetadataSearch.getIdsWithOrd(result, escapedFields.get(filterField), ords);
if (result.getLength() <= 0) {
return result;
}
Expand Down

0 comments on commit 3434d2d

Please sign in to comment.