Performs search on the Cache based on the query specified.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)

Syntax

C#
public virtual ICollection Search(
	string query,
	IDictionary values
)
Visual Basic
Public Overridable Function Search ( _
	query As String, _
	values As IDictionary _
) As ICollection
Visual C++
public:
virtual ICollection^ Search(
	String^ query, 
	IDictionary^ values
)

Parameters

query
Type: System..::..String
simple SQL like query syntax to query objects from cache
values
Type: System.Collections..::..IDictionary
The IDictionary of atribute names and values.

Return Value

Returns a list of cache keys

Examples

These operators are supported by NCache Queries. 1. Comparison Operators = , == , != , <> , < , > , <=, >=, IN 2. Logical Operators AND , OR , NOT 3. Miscellaneous () , DateTime.Now , DateTime("any date time compatible string")
CopyC#
Hashtable values = new Hashtable();
values.add("Name", "Paul Jones");
"select Test.Application.Employee where this.Name = ?"

values.add("Salary", 2000);
"select Test.Application.Employee where this.Salary > ?"

values.Add("Name", "Paul jones");
values.Add("Salary", 2000);
"select Test.Application.Employee where this.Name = ? and this.Salary > ?"

values.Add("Name", "Paul Jones");
values.Add("Salary", 2000);
"select Test.Application.Employee where Not(this.Name = 'Paul Jones' and this.Salary > 2000)"

See Also