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.3.0.0 (4.3.0.0)

Syntax

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

Parameters

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

Return Value

Type: ICollection
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")
 Copy imageCopy
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