1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 09:46:17 +00:00

#247: upgrade dependencies

This commit is contained in:
Benjamin Gamard
2018-10-21 11:54:19 +02:00
parent b2b4eed4fa
commit a9648f803c
7 changed files with 46 additions and 56 deletions

View File

@@ -39,7 +39,6 @@ import org.apache.lucene.store.Directory;
import org.apache.lucene.store.NoLockFactory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.lucene.util.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -110,13 +109,7 @@ public class LuceneIndexingHandler implements IndexingHandler {
log.info("Checking index health and version");
try (CheckIndex checkIndex = new CheckIndex(directory)) {
CheckIndex.Status status = checkIndex.checkIndex();
if (status.clean) {
for (CheckIndex.Status.SegmentInfoStatus segmentInfo : status.segmentInfos) {
if (!segmentInfo.version.onOrAfter(Version.LATEST)) {
throw new Exception("Index is old (" + segmentInfo.version + ")");
}
}
} else {
if (!status.clean) {
throw new Exception("Index is dirty");
}
}
@@ -352,7 +345,7 @@ public class LuceneIndexingHandler implements IndexingHandler {
return;
}
FuzzySuggester suggester = new FuzzySuggester(new StandardAnalyzer());
FuzzySuggester suggester = new FuzzySuggester(directory, "", new StandardAnalyzer());
LuceneDictionary dictionary = new LuceneDictionary(directoryReader, "title");
suggester.build(dictionary);
int lastIndex = search.lastIndexOf(' ');

View File

@@ -73,11 +73,12 @@ public class ImageUtil {
* @param email Email
* @return Gravatar hash
*/
@SuppressWarnings("deprecation") // Gravatar uses MD5, nothing we can do about it
public static String computeGravatar(String email) {
if (email == null) {
return null;
}
return Hashing.md5().hashString(
email.trim().toLowerCase(), Charsets.UTF_8)
.toString();