Skip to content

Commit

Permalink
apply facet filter to query when facet is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
omarkhan committed Mar 20, 2013
1 parent bdcd5d6 commit fdda39c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jquery.facetview.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,8 +961,15 @@ Updates the URL string with the current query when the user changes the
}
}
} else {
var rel = $(this).attr('rel');
var facet = options.facets.filter(function(f) {
return f['field'] === rel && f['facet_filter'];
})[0];
var bobj = {'term':{}};
bobj['term'][ $(this).attr('rel') ] = $(this).attr('href');
bobj['term'][rel] = $(this).attr('href');
if (facet) {
qs['filter'] = facet['facet_filter'];
}
}

// check if this should be a nested query
Expand Down

0 comments on commit fdda39c

Please sign in to comment.