Skip to content
Snippets Groups Projects
Commit a3d5b0d4 authored by srosse's avatar srosse
Browse files

OO-3106: exclude large doc per default, fail fats if the index directory...

OO-3106: exclude large doc per default, fail fats if the index directory doesn't exists, remove print out
parent 029772aa
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,6 @@ public class QuestionItemDocumentFactory {
oDocument.setParentContextType(searchResourceContext.getParentContextType());
oDocument.setParentContextName(searchResourceContext.getParentContextName());
System.out.println(item.getTitle());
//author
StringBuilder authorSb = new StringBuilder();
List<Identity> owners = qpoolService.getAuthors(item);
......
......@@ -80,6 +80,8 @@
<list>
<!-- list of files which will not be indexed -->
<value>ppt</value>
<value>doc</value>
<value>xls</value>
</list>
</constructor-arg>
</bean>
......
......@@ -598,10 +598,13 @@ public class SearchServiceImpl implements SearchService, GenericEventListener {
throws IOException {
try {
File indexFile = new File(searchModuleConfig.getFullIndexPath());
Directory directory = FSDirectory.open(indexFile);
File permIndexFile = new File(searchModuleConfig.getFullPermanentIndexPath());
Directory permDirectory = FSDirectory.open(permIndexFile);
return DirectoryReader.indexExists(directory) && DirectoryReader.indexExists(permDirectory);
if(indexFile.exists()) {
Directory directory = FSDirectory.open(indexFile);
File permIndexFile = new File(searchModuleConfig.getFullPermanentIndexPath());
Directory permDirectory = FSDirectory.open(permIndexFile);
return DirectoryReader.indexExists(directory) && DirectoryReader.indexExists(permDirectory);
}
return false;
} catch (IOException e) {
throw e;
}
......
......@@ -34,7 +34,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.olat.core.gui.util.CSSHelper;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
......@@ -87,12 +87,10 @@ public class ExcelDocument extends FileDocument {
for (int cellNumber = row.getFirstCellNum(); cellNumber <= row.getLastCellNum(); cellNumber++) {
HSSFCell cell = row.getCell(cellNumber);
if (cell != null) {
// if (cell.getCellStyle().equals(HSSFCell.CELL_TYPE_NUMERIC))
if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
if (cell.getCellTypeEnum() == CellType.STRING) {
content.append(cell.getStringCellValue()).append(' ');
}
} else {
// throw new DocumentException();
cellNullCounter++;
}
}
......
......@@ -249,7 +249,7 @@ public class FileDocumentFactory {
if (searchModule.getFileSizeSuffixes().contains(suffix)) {
long maxFileSize = searchModule.getMaxFileSize();
if ( (maxFileSize != 0) && (fileSize > maxFileSize) ) {
log.info("File too big, exlude from search index. filename=" + fileName);
log.info("File too big, exclude from search index. filename=" + fileName);
excludedFileSizeCount++;
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment