NHibernate.Search 코드를 수정하여 사용자 정의 페이징을 사용할 수 있습니다. IE는 검색에 대한 히트 수를 얻은 다음 그에 따라 nhibernate 검색 결과를 페이지합니다.
public IList<TEntity> Search<TEntity>(Query query, bool? active, string orderBy)
{
var search = NHibernate.Search.Search.CreateFullTextSession(this.session);
var total = search.CreateFullTextQuery(query, typeof(TEntity)).ResultSize;
var first = 0;
var l = new List<TEntity>();
while (total > 0)
{
l.AddRange(search.CreateFullTextQuery(query, typeof(TEntity))
.SetFirstResult(first)
.SetMaxResults(1000)
.List<TEntity>());
first += 1000;
total -= 1000;
}
return l;
}
참조 : IFullTextQuery - exception if there are too may objects