Signature
Import
- Component
- Plugin
To ensure optimal bundle sizes,
see Optimize build size.
Vue
About this widget
Virtual indices let you use relevant sort, a sorting mechanism that favors relevancy over the attribute you’re sorting on. Theais-relevant-sort
widget displays the current search mode when searching in a virtual replica index,
and allows users to switch between relevant and regular sorting,
which is more exhaustive but can return less relevant results.
Examples
Vue
Props
The CSS classes you can override:
ais-RelevantSort
. The root element of the widget.ais-RelevantSort-text
. The text element.ais-RelevantSort-button
. The button element.
Vue
default
The slot to override the complete DOM output of the widget.When you implement this slot, none of the other slots will change the output, as the default slot surrounds them.Scope
isRelevantSorted: boolean
. True if the current index is using Relevant sort.refine: function
. Function to toggle between showing relevant or all results.
Vue
text
The slot to override the introductory text.Scope
isRelevantSorted: boolean
. True if the current index is Relevant sorted.
Vue
button
The slot to override the toggle button.Scope
isRelevantSorted: boolean
. True if the current index is using Relevant sort.
Vue
HTML output
HTML