Do you need any help with Migration?

Not Now Yes, Contact Support

You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Migration: How to Migrate Suggestions from 3.x

Suggestion functionality has been merged into RQL. To reflect this change, the Client API has integrated this feature into the session.Query and session.Advanced.DocumentQuery. The following migration samples will focus on the session.Query, the most common and recommended way of interaction with querying capabilities on RavenDB.


using Raven.Abstractions.Data;
using Raven.Client;
using Raven.Client.Documents;
using Raven.Client.Documents.Queries.Suggestions;


SuggestionQueryResult suggestions = session
    .Query<Employee, Employees_ByFullName>()
        new SuggestionQuery
            Field = "FullName",
            Term = "johne",
            Accuracy = 0.4f,
            MaxSuggestions = 5,
            Distance = StringDistanceTypes.JaroWinkler,
            Popularity = true,
Dictionary<string, SuggestionResult> suggestions = session
    .Query<Employee, Employees_ByFullName>()
    .SuggestUsing(builder => builder
        .ByField("FullName", "johne")
        .WithOptions(new SuggestionOptions
            Accuracy = 0.4f,
            PageSize = 5,
            Distance = StringDistanceTypes.JaroWinkler,
            SortMode = SuggestionSortMode.Popularity



You can read more about Suggestions in a dedicated Client API article that can be found here.