Search results custom order
Search results custom order
ZeroVB
Posts: 2Questions: 1Answers: 0
Hi!
I need to sort the search results in the following order:
1º: strings where the match is at the beginning of the string
2º: strings where the match is at the beginning of any word (not on the first)
3º: strings where the match is anywhere of the string
This sorting should only be applied when showing search results, it must not affect previous sorting.
¿How can i acomplish this?
Thanks!
This discussion has been closed.
Answers
You will have to write your own code for sorting your search result.
Yeah, i know.
But what's the best way to do that? I don't know datatables source code in deep.
Applying filter after the search was done seems to be not optimal. Is there a way i can proxify the search function and pass the results as an ordered array to show up?
Also how can i save the current sort state so after clearing search it returns to original.
Thanks!