You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: SearchAsync

SearchAsync retrieves the names of configurations that starts with a specified prefix.

Syntax

Task<ConfigurationSearchResults> SearchAsync(string prefix, int start = 0, int pageSize = 25);

Parameters
prefix string The prefix value with which the name of a configuration has to start
start int The number of results that should be skipped
pageSize int The maximum number of results that will be returned

Return Value
Task<ConfigurationSearchResults> A task that represents the asynchronous operation. The task result is ConfigurationSearchResults object which represents results of a prefix query.

Example

In order to get all configuration names which keys start with descriptions/ prefix you can use the following code:

int start = 0;
int pageSize = 10;

do
{
	ConfigurationSearchResults results = await store
		.AsyncFilesCommands
		.Configuration
		.SearchAsync("descriptions/", start, pageSize);

	IList<string> names = results.ConfigNames;

	start += pageSize;
	
	if(names.Count < pageSize)
		break;

} while (true);