feat: There is no way the, 优化ES 坑
This commit is contained in:
+4
@@ -2979,16 +2979,19 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
|
XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
|
||||||
String txt = extractor.getText();
|
String txt = extractor.getText();
|
||||||
content.append(txt);
|
content.append(txt);
|
||||||
|
extractor.close();
|
||||||
}else {
|
}else {
|
||||||
WordExtractor wordExtractor = new WordExtractor(fis);
|
WordExtractor wordExtractor = new WordExtractor(fis);
|
||||||
String txt = wordExtractor.getText();
|
String txt = wordExtractor.getText();
|
||||||
content.append(txt);
|
content.append(txt);
|
||||||
|
wordExtractor.close();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
OPCPackage opcPackage = XWPFDocument.openPackage(readFilePath);
|
OPCPackage opcPackage = XWPFDocument.openPackage(readFilePath);
|
||||||
XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
|
XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
|
||||||
String txt = extractor.getText();
|
String txt = extractor.getText();
|
||||||
content.append(txt);
|
content.append(txt);
|
||||||
|
opcPackage.close();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PDDocument document = PDDocument.load(new File(readFilePath));
|
PDDocument document = PDDocument.load(new File(readFilePath));
|
||||||
@@ -3000,6 +3003,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
|||||||
String pdfFileInText = tStripper.getText(document);
|
String pdfFileInText = tStripper.getText(document);
|
||||||
// String[] lines = pdfFileInText.split("\\r?\\n");
|
// String[] lines = pdfFileInText.split("\\r?\\n");
|
||||||
content.append(pdfFileInText);
|
content.append(pdfFileInText);
|
||||||
|
document.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user