Global Search
Examples click to try live
Text Index Search
floyd young

Uses MongoDB $text when a text index exists.

Phrase Search
"Dark Side" "On The Beach"

Wrap in quotes for exact phrase matching.

Multi-word Search
pink floyd 1973 jazz columbia

MongoDB $text scores all words — enable Regex for strict per-word AND matching.

Field Targeting
artist:Bowie artist:"David Bowie" label:Harvest

Colon syntax targets a specific field.

Comparison Operators
year:1977 year:>1980 year:>=1975 year:<1980 rating:>=4

> >= < <= on number/date fields.

Regex Mode
^Walk pink floyd 1973 jazz columbia Floyd|Bowie ^The & Waits|Young|Reed ^(Black|Led) \*$ ^[A-Z][a-z]+\s[A-Z][a-z]+$ ^(?!The\s).*&.*

Enable Regex toggle, then enter raw patterns.

ArtistTitleLabel YearGenreFormatRating
How It Works
Client — DataTables Search API

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 }
Server — mongo-datatables

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 } }