Explore every search mode — click an example to try it live
Uses MongoDB $text when a text index exists.
Wrap in quotes for exact phrase matching.
MongoDB $text scores all words — enable Regex for strict per-word AND matching.
Colon syntax targets a specific field.
> >= < <= on number/date fields.
Enable Regex toggle, then enter raw patterns.
| Artist | Title | Label | Year | Genre | Format | Rating | |
|---|---|---|---|---|---|---|---|
The global search box sends search[value], search[regex], and search[caseInsensitive] with every Ajax request.
Smart search (default) uses MongoDB $text — multi-word queries are scored as a bag of words, not strict AND.
Enable Regex to switch to per-word $regex AND matching across columns.
Per-column search uses columns[i][search][value] — the footer inputs here send column-specific terms.
// Colon syntax is parsed server-side:
table.search('artist:Bowie year:>1975').draw();
// Column search with pipe range:
table.column(4).search('1975|1980').draw();
// Toggle regex/case via the request payload:
search: { value: '^Dark', regex: true,
caseInsensitive: true }
The library parses search[value] and detects colon syntax, quoted phrases, and comparison operators.
With a text index, plain terms use $text (fast). Colon syntax generates targeted $regex or $gt/$lt queries.
Column search pipe ranges become { $gte: min, $lte: max }. DataField types determine whether comparison operators are valid.
# "artist:Bowie year:>1975" becomes:
{ "$and": [
{ "artist": { "$regex": "Bowie", "$options": "i" } },
{ "year": { "$gt": 1975 } }
]}
# Column search "1975|1980" on year becomes:
{ "year": { "$gte": 1975, "$lte": 1980 } }