When searching for multiple values like a list of IDs, generate the
cache key from the sorted JSON form of the search value instead of the
bare ARRAY ref.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
my ($field, $val, $filterfield, $filterval) = @_;
my $method = "search_$eclass";
my $cacheval = $val;
+ if (ref $val) {
+ $val = [sort(@$val)] if ref $val eq 'ARRAY';
+ $cacheval = OpenSRF::Utils::JSON->perl2JSON($val);
+ #$self->apache->log->info("cacheval : $cacheval");
+ }
my $search_obj = {$field => $val};
if($filterfield) {
$search_obj->{$filterfield} = $filterval;