Skip to content

Commit

Permalink
Append / to children facet queries
Browse files Browse the repository at this point in the history
Extra slash ensures we match `/1/SI/*` and not `/1/SI*` which could
cause extra entries which are not actually children of that root node
  • Loading branch information
thostetler committed May 31, 2022
1 parent 52201ea commit f3f9e18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/widgets/facet/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ define([
// we don't need actual records so set rows to 1
q.set('rows', 1);
// set prefix from 0/ to 1/
if (id) q.set('facet.prefix', id.replace('0/', '1/'));
if (id) {
// append '/' so that we properly match the prefix
const childPrefix = id.replace('0/', '1/') + '/';
q.set('facet.prefix', childPrefix);
}

var req = this.composeRequest(q);
pubsub.publish(pubsub.DELIVERING_REQUEST, req);
Expand Down

0 comments on commit f3f9e18

Please sign in to comment.