Hibernate Search在进行索引时挂起

时间:2016-10-25 11:44:30

标签: java hibernate

我有一个问题,即hibernate搜索质量索引在生产环境中卡住/挂起,而它在开发环境中正常工作。 以下是质量索引的代码:

public ActionResult ExportToExcel()
    {
        Load l = new Load();
        List<Load> loadList = l.GetLoadsForGroup(date, groupID);

        var fileDownloadName = "fileName.xlsx";
        var contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

        ExcelPackage pck = new ExcelPackage();
        var ws = pck.Workbook.Worksheets.Add("New workbook");
        ws.View.ShowGridLines = true;
        ws.DefaultColWidth = 25;
        ws.Cells[1, 1].Value = "Order #";

        var currRow = 2;
        foreach (var load in loadList)
        {
            ws.Cells[2, 2].Value = load.LoadNumber;
        }

        Response.Clear();
        Response.ContentType = contentType;
        Response.AddHeader("content-disposition", "attachment; filename=\"" + fileDownloadName + "\"");
        Response.BinaryWrite(pck.GetAsByteArray());
        Response.Flush();
        Response.End();
        return View();
    }

以下是显示挂起/卡住位置的日志:

fullTextSession.purgeAll(entityClass);

fullTextSession
        .createIndexer( entityClass )
        .batchSizeToLoadObjects(Integer.parseInt(getConfigProperty(CommonConstants.CONFIGKEY_INDEXER_BATCH_SIZE))) //200
        .cacheMode( CacheMode.IGNORE )
        .threadsToLoadObjects(Integer.parseInt(getConfigProperty(CommonConstants.CONFIGKEY_INDEXER_THREAD_COUNT))) //5
        .idFetchSize(Integer.parseInt(getConfigProperty(CommonConstants.CONFIGKEY_INDEXER_FETCH_SIZE))) //1000
        .progressMonitor( new SimpleIndexingProgressMonitor() ) //a MassIndexerProgressMonitor implementation
        .startAndWait();

无论如何我能找到问题所在吗?

非常感谢。

0 个答案:

没有答案