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

Merge OpenOLAT 12.1 to OpenOLAT default branch with d45704c85928fc6594b45279fc6801f998dc3d72

parents f0174c51 a3d5b0d4
No related branches found
No related tags found
No related merge requests found
...@@ -80,6 +80,8 @@ ...@@ -80,6 +80,8 @@
<list> <list>
<!-- list of files which will not be indexed --> <!-- list of files which will not be indexed -->
<value>ppt</value> <value>ppt</value>
<value>doc</value>
<value>xls</value>
</list> </list>
</constructor-arg> </constructor-arg>
</bean> </bean>
......
...@@ -598,10 +598,13 @@ public class SearchServiceImpl implements SearchService, GenericEventListener { ...@@ -598,10 +598,13 @@ public class SearchServiceImpl implements SearchService, GenericEventListener {
throws IOException { throws IOException {
try { try {
File indexFile = new File(searchModuleConfig.getFullIndexPath()); File indexFile = new File(searchModuleConfig.getFullIndexPath());
Directory directory = FSDirectory.open(indexFile); if(indexFile.exists()) {
File permIndexFile = new File(searchModuleConfig.getFullPermanentIndexPath()); Directory directory = FSDirectory.open(indexFile);
Directory permDirectory = FSDirectory.open(permIndexFile); File permIndexFile = new File(searchModuleConfig.getFullPermanentIndexPath());
return DirectoryReader.indexExists(directory) && DirectoryReader.indexExists(permDirectory); Directory permDirectory = FSDirectory.open(permIndexFile);
return DirectoryReader.indexExists(directory) && DirectoryReader.indexExists(permDirectory);
}
return false;
} catch (IOException e) { } catch (IOException e) {
throw e; throw e;
} }
......
...@@ -34,7 +34,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow; ...@@ -34,7 +34,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; 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.gui.util.CSSHelper;
import org.olat.core.logging.OLog; import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing; import org.olat.core.logging.Tracing;
...@@ -87,12 +87,10 @@ public class ExcelDocument extends FileDocument { ...@@ -87,12 +87,10 @@ public class ExcelDocument extends FileDocument {
for (int cellNumber = row.getFirstCellNum(); cellNumber <= row.getLastCellNum(); cellNumber++) { for (int cellNumber = row.getFirstCellNum(); cellNumber <= row.getLastCellNum(); cellNumber++) {
HSSFCell cell = row.getCell(cellNumber); HSSFCell cell = row.getCell(cellNumber);
if (cell != null) { if (cell != null) {
// if (cell.getCellStyle().equals(HSSFCell.CELL_TYPE_NUMERIC)) if (cell.getCellTypeEnum() == CellType.STRING) {
if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
content.append(cell.getStringCellValue()).append(' '); content.append(cell.getStringCellValue()).append(' ');
} }
} else { } else {
// throw new DocumentException();
cellNullCounter++; cellNullCounter++;
} }
} }
......
...@@ -249,7 +249,7 @@ public class FileDocumentFactory { ...@@ -249,7 +249,7 @@ public class FileDocumentFactory {
if (searchModule.getFileSizeSuffixes().contains(suffix)) { if (searchModule.getFileSizeSuffixes().contains(suffix)) {
long maxFileSize = searchModule.getMaxFileSize(); long maxFileSize = searchModule.getMaxFileSize();
if ( (maxFileSize != 0) && (fileSize > maxFileSize) ) { 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++; excludedFileSizeCount++;
return false; 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