Distinct method allows you to remove duplicates from the result. Items are compared based on fields listed in the
select section of the query.
// returns sorted list of countries w/o duplicates IList<string> countries = session .Query<Order>() .OrderBy(x => x.ShipTo.Country) .Distinct() .Select(x => x.ShipTo.Country) .Distinct() .ToList();
from Orders select distinct ShipTo.Country
Please read the dedicated article about paging through tampered results. This kind of paging is required when using a distinct keyword.