doColumnSearch: Server-side searching

View source: R/shiny.R

doColumnSearchR Documentation

Server-side searching


doGlobalSearch() can be used to search a data frame given the search string typed by the user into the global search box of a datatable. doColumnSearch() does the same for a vector given the search string typed into a column filter. These functions are used internally by the default filter function passed to dataTableAjax(), allowing you to replicate the search results that server-side processing returns.


doColumnSearch(x, search_string, options = list())

doGlobalSearch(data, search_string, options = list())



a vector, the type of which determines the expected search_string format


a string that determines what to search for. The format depends on the type of input, matching what a user would type in the associated filter control.


a list of options used to control how searching character values works. Supported options are regex, caseInsensitive and (for global search) smart.


a data frame


An integer vector of filtered row indices

See Also

The column filters section online for search string formats:

Accessing the search strings typed by a user in a Shiny app:


doGlobalSearch(iris, "versi")
doGlobalSearch(iris, "v.r.i", options = list(regex = TRUE))

doColumnSearch(iris$Species, "[\"versicolor\"]")
doColumnSearch(iris$Sepal.Length, "4 ... 5")

DT documentation built on May 11, 2022, 1:09 a.m.