function buildIndex(event, url)
{
if(url === undefined)
{
url = $.createLink('search', 'buildIndex', 'mode=build');
$(event.target).hide();
}
$.getJSON(url, function(response)
{
if(response.result == 'finished')
{
$('#buildResult').append("
');
return false;
}
else
{
const className = response.type + 'count';
const $typeCount = $('#buildResult .' + className)
if($typeCount.length == 0)
{
$('#buildResult').append("');
}
else
{
const count = parseInt($typeCount.html()) + parseInt(response.count);
$typeCount.html(count);
}
return buildIndex(event, response.next);
}
});
return false;
};