Skip to content

Commit

Permalink
#2005 remove blank title
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Feb 6, 2019
1 parent 32b3c9e commit a8e292c
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -219,21 +219,23 @@ protected Map<String, Object> generateData(final ResponseData responseData) {
// title
final String fileName = getFileName(url, urlEncoding);
if (!hasTitle(dataMap)) {
final String titleField = fessConfig.getIndexFieldTitle();
dataMap.remove(titleField);
if (url.endsWith("/")) {
if (StringUtil.isNotBlank(content)) {
putResultDataBody(
dataMap,
fessConfig.getIndexFieldTitle(),
titleField,
documentHelper.getDigest(responseData, body, dataMap,
fessConfig.getCrawlerDocumentFileMaxTitleLengthAsInteger()));
} else {
putResultDataBody(dataMap, fessConfig.getIndexFieldTitle(), fessConfig.getCrawlerDocumentFileNoTitleLabel());
putResultDataBody(dataMap, titleField, fessConfig.getCrawlerDocumentFileNoTitleLabel());
}
} else {
if (StringUtil.isBlank(fileName)) {
putResultDataBody(dataMap, fessConfig.getIndexFieldTitle(), decodeUrlAsName(url, url.startsWith("file:")));
putResultDataBody(dataMap, titleField, decodeUrlAsName(url, url.startsWith("file:")));
} else {
putResultDataBody(dataMap, fessConfig.getIndexFieldTitle(), fileName);
putResultDataBody(dataMap, titleField, fileName);
}
}
}
Expand Down

0 comments on commit a8e292c

Please sign in to comment.