You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorting binds to an element to display sorting controls for the results of an AjaxSearch. It allows to re-run the last query with a modified scoringFunction, when a label is clicked.
Usage
var s = $("#sorting").indextank_Sorting({labels: {"relevance": 0, "newest": "1"}});
$("#query").indextank_AjaxSearch({listeners: s});
Options
labels: an Object with function names as keys and integers as values. In the example above, relevance is the function 0, and newest is the function 1. Make sure the names match the semantics for the functions defined for your index.
Events
Reacts to
Indextank.AjaxSearch.success: Keeps track of the latest query, to re-run it with a modified scoringFunction if needed.
Triggers
Indextank.AjaxSearch.runQuery: When a label is clicked, it clones the last query, changes the scoringFunction and re-runs it.