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

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: Querying: How to work with Suggestion query?

To take advantage of a suggestion feature use the Suggest endpoint.


curl \
	http://{serverName}/databases/{databaseName}/suggest/{indexName}? \
		&term={term} \
		&field={field} \
		&max={max} \
		&popularity={popularity} \
		&distance={distance} \
		&accuracy={accuracy} \


Query parameter Required Description
index Yes A name of an index to query.
term Yes term used to compute suggestions
field Yes field used for suggestions
max No maximum number of suggestions
popularity No sort results by popularity
distance No method used for computing distance
accuracy No accuracy level


Status code Description
200 OK
Return Value Description
Suggestions array of suggestions
Header Description
ETag index etag


curl -X GET "http://localhost:8080/databases/NorthWind/suggest/Users/ByFullName?term=johne&field=FullName&max=10&popularity=false&distance=Levenshtein" 

< HTTP/1.1 200 OK
{ "Suggestions" : [ "john", "jones", "johnson" ] }