SearchService

SearchService

This interface contains properties and methods required for a Search Service.


Constructor

# new SearchService()

Methods

# (async) executeNonQuery(queryCommand)

Executes Delete statements on cache. Returns number of affected rows after query is executed.

Parameters:
Name Type Description
queryCommand QueryCommand

QueryCommand containing query text and values.

Returns:

Number of rows affected after query is executed.

# (async) executeReader(queryCommand, getData, chunkSize) → {CacheReader}

Performs search on the cache based on the query specified. Returns list of key-value pairs in a data reader which fulfills the query criteria. This key-value pair has cache key and its respective value. You can specify the flag for specifying if you want data with keys.

Parameters:
Name Type Default Description
queryCommand QueryCommand

QueryCommand containing query text and values.

getData boolean true

Flag to indicate whether the resulting values have to be returned with keys or not.

chunkSize number

Size of data/keys packets received after search, default value is 512*1024 KB.

Returns:

Reads forward-only stream of result sets of the query executed on cache.

Type
CacheReader

# (async) executeScalar(queryCommand, cls)

Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.

Parameters:
Name Type Description
queryCommand QueryCommand

QueryCommand containing query text and values.

cls number

Specifies the class of value obtained from the cache.

Returns:

The first column of the first row in the result set, or null if the result set is empty.

# (async) getByTag(wildCardExpression)

Gets all the cached items with the wild card supported tag.

Parameters:
Name Type Description
wildCardExpression String

The wild card Expression to search with.

Returns:

Map<String(key), NodeList>

# (async) getByTags(tags, tagSearchOptions)

Returns the cached objects that have tags with specified TagSearchOptions.

Parameters:
Name Type Description
tags Array.<Tag>

List of tags to search cache with.

tagSearchOptions TagSearchOption

TagSearchOptions specifies the search type for the tags.

Returns:

Map<String(key), NodeList>

# (async) getGroupData(group)

Retrieves the key and value pairs of the specified group.

Parameters:
Name Type Description
group string

Name of group whose Data are to be returned.

Returns:

Map<key,NodeList> A Map containing key-value pairs of the specified group.

# (async) getGroupKeys(group)

Retrieves the keys of the items in the specified group.

Parameters:
Name Type Description
group string

Name of group whose keys are to be returned.

Returns:

Array Collection of keys of the group.

# (async) getKeysByTag(wildCardExpression)

Gets all the keys with the wild card supported tag.

Parameters:
Name Type Description
wildCardExpression Array.<string>

The wild card Expression to search with.

Returns:

Array

# (async) getKeysByTags(tags, searchOptions)

Returns keys of the cached items that have tags with specified TagSearchOptions.

Parameters:
Name Type Description
tags Array.<Tag>

List of tags to search cache with.

searchOptions TagSearchOptions

TagSearchOptions specifies the search type for the tags.

Returns:

Array Collection containing the cache keys.

# (async) removeByTag(tag)

Removes the cached objects with the specified tag.

Parameters:
Name Type Description
tag Tag

A Tag to search cache with.

# (async) removeByTags(tags, searchOptions)

Removes the cached objects that have tags with specified TagSearchOptions.

Parameters:
Name Type Description
tags Array.<Tag>

List of tags to search cache with.

searchOptions TagSearchOptions

TagSearchOptions specifies the search type for the tags.

# (async) removeGroupData(group)

Remove the data items pertaining to the specified group from cache.

Parameters:
Name Type Description
group string

Name of group to be removed.