As per my requirement, I am indexing custom objects into EpiServer find.
So here, I am indexing 50 records at a time. My question is, what is the best practice to index max objects at a time. Do we get any issues if we index more multile objects at a time?
private readonly IClient _client;
public void GetDataToRebuildIndex() { var list = _findRepository.GetDataToRebuildIndex(); int totalRecords = list != null ? list.Count() : 0; if (totalRecords > 0) { int indexPageSize = 50; int pageNumbers = Convert.ToInt32(Math.Ceiling(totalRecords / Convert.ToDouble(indexPageSize))); for (int i = 0; i < pageNumbers; i++) { _client.Index(list.Skip(i * indexPageSize).Take(indexPageSize)); }
Hi Team,
As per my requirement, I am indexing custom objects into EpiServer find.
So here, I am indexing 50 records at a time. My question is, what is the best practice to index max objects at a time. Do we get any issues if we index more multile objects at a time?
private readonly IClient _client;
public void GetDataToRebuildIndex()
{
var list = _findRepository.GetDataToRebuildIndex();
int totalRecords = list != null ? list.Count() : 0;
if (totalRecords > 0)
{
int indexPageSize = 50;
int pageNumbers = Convert.ToInt32(Math.Ceiling(totalRecords / Convert.ToDouble(indexPageSize)));
for (int i = 0; i < pageNumbers; i++)
{
_client.Index(list.Skip(i * indexPageSize).Take(indexPageSize));
}
}
}