<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="columns">
	<name>column().search()</name>
	<summary>Search for data in the selected column.</summary>
	<since>1.10</since>

	<type type="function">
		<signature>column().search()</signature>
		<description>Get the currently applied column search.</description>
		<returns type="string">Search term that is currently applied to the column. This will be an empty string if no search search term is applied.</returns>
	</type>
	<type type="function">
		<signature>column().search( input [, regex[ , smart[ , caseInsen ]]] )</signature>
		<description>Set the search term for the column from the selector. Note this doesn't actually perform the search, but rather queues it up - use `dt-api draw()` to perform the search and display the result.</description>
		<parameter type="string" name="input">
			Search string to apply to the selected column.
		</parameter>
		<parameter type="boolean" name="regex" default="false">
			Treat as a regular expression (`true`) or not (default, `false`).
		</parameter>
		<parameter type="boolean" name="smart" default="true">
			Perform smart search (default, `true`) or not (`false`). Note that to perform a "smart" search, DataTables uses regular expressions, so if you pass a regular expression in as the second parameter to this method, you will likely want to disable smart searching so the two different regular expressions don't conflict.
		</parameter>
		<parameter type="boolean" name="caseInsen" default="true">
			Do case-insensitive matching (default, `true`) or not (`false`).
		</parameter>
		<returns type="DataTables.Api">DataTables API instance</returns>
	</type>

	<description>
		While `dt-api search()` provides the ability to search globally across the table, this method, and its plural counterpart, provide the ability to search for data on a specific column.

		DataTables does not have any column search controls built-in as there are so many different ways that column specific data could be searched, but this method makes adding custom column search controls super easy. The examples below show how it may be used.

		Note that this search ability in DataTables is actually technically a filter since it is subtractive. However, we term it a search to avoid a naming overlap with the `dt-api filter` helper method.

		Please be aware that this method sets the search to apply to the table only - it does not actually perform the search. In order to have the search performed and the result shown, use the `dt-api draw()` method, which can be called simply as a chained method of the `dt-api column().search()` method's returned object - for example `table.column( 0 ).search( 'Fred' ).draw();`. This is to provide the ability to queue multiple changes before performing a draw.
	</description>

	<example title="Individual column search"><![CDATA[
var table = $('#example').DataTable();

// #column3_search is a <input type="text"> element
$('#column3_search').on( 'keyup', function () {
	table
		.columns( 3 )
		.search( this.value )
		.draw();
} );
]]></example>

	<example title="Build a search for each column with a `select-filter` class."><![CDATA[
var table = $('#example').DataTable();

table.columns( '.select-filter' ).every( function () {
	var that = this;

	// Create the select list and search operation
	var select = $('<select />')
		.appendTo(
			this.footer()
		)
		.on( 'change', function () {
			that
				.search( $(this).val() )
				.draw();
		} );

	// Get the search data for the first column and add to the select list
	this
		.cache( 'search' )
		.sort()
		.unique()
		.each( function ( d ) {
			select.append( $('<option value="'+d+'">'+d+'</option>') );
		} );
} );

]]></example>

	<related type="option">searching</related>
	<related type="option">columns.searchable</related>
	<related type="api">search()</related>
	<related type="api">columns().search()</related>
	<related type="api">$.fn.dataTable.util.escapeRegex()</related>
</dt-api>
