Shortest match first
Shortest match first
spidogr
Posts: 23Questions: 9Answers: 0
For example there could be cells like these:
this is a big row
this is a small row
this is a another row
another row
small row
row
in which case the preferred first match when searching “row” should be the cell which contains just that.
Replies
The search and the ordering are entirely independent, but you could create a custom ordering plugin (see here) that orders a column by the length of its contents.
Colin
If you want to match a specific word then you will want to use regex searching. See this example:
https://datatables.net/examples/api/regex.html
Kevin
I am interested in how the results are displayed after a Search.
I checked the regex, but I cannot understand how I could make it match by default the full cell content and/or the shortest cell content (and the rest of the matches further down on the same logic). For example I tried ^developer to match Developer **only but not **Javascript Developer and I got nothing.
I see that in the roadmap v1.11 is meant to address Search weaknesses.
Did you check regex and uncheck smart search? Like this:
Kevin
I was doing it on Global search. It only works for Position search.
Yeah, there are a few threads on that, such as this one here - see Allan's comment at the end. I agree it's non-intuitive, it caught me out too!
Colin