the search field of admin-panel datatables was tuned/configured
over time to allow fastest possible search, "as-you-type".
for large tabels it eg. will only include indexed columns, which
never was transparent to the users.
the UI will now display tooltip texts with detailed hints about
included columns, wildcard support, etc.
Change-Id: I737732a55003d50068236bb0150a2f47d06deaf5
(cherry picked from commit ff198cef49)
has'search_tooltip'=>(isa=>'Str',is=>'rw',default=>'Filter for column values matching the pattern string, e.g. 12*45. The * (wildcard) is implicitly prepended and appended.');
has'search_tooltip'=>(isa=>'Str',is=>'rw');
#didn't want to include some complex role related logic here,
#for search string from one search input we need to check all columns which contain the 'search' spec (now: qw/search search_lower_column search_upper_column/). so, for example user entered into search input ip address - we don't know that it is ip address, so we check that name like search OR id like search OR search is between network_lower_value and network upper value
foreachmy$col(@{$cols}){
nextunless$col->{name};
my($name,$search_value,$op,$convert);
# avoid amigious column names if we have the same column in different joined tables
helper.search_tooltip = c.loc('Filter records for values of columns matching either condition:') _ '<dl>';
FOR col IN helper.dt_columns;
IF !col.accessor;
col.accessor = col.name;
col.accessor = col.accessor.replace('\.','_');
END;
IF col.strict_search;
helper.strict_search = 1;
search_dt = col.title;
UNLESS search_dt;
search_dt = col.accessor;
END;
search_dd = '';
IF col.search;
search_dd = c.loc('Search by wildcard pattern. A wildcard is implicitly appended at the end of the search string if no wildcard is used. A leading wildcard prevents using databases indexes (slow).');
ELSIF col.strict_search;
search_dd = c.loc('Search by the exact search string value (The * wildcard is considered as a literal string).');
ELSIF col.int_search;
search_dd = c.loc('Search string is converted to an integer value to search for.');
helper.identifier = 0; # make sure we don't use the same identifier twice
IF search_tooltip;
helper.search_tooltip = c.loc(search_tooltip);
ELSIF helper.strict_search;
helper.search_tooltip = c.loc('Filter for column values matching the string, e.g. 12345. A leading * (wildcard) can result in long response times.');
ELSE;
helper.search_tooltip = c.loc('Filter for column values matching the pattern string, e.g. 12*45. The * (wildcard) is implicitly prepended and appended.');