From 566b408dddc70bea1cc2ee9c2c80a3a186421d73 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 29 Jan 2015 13:56:55 +0100 Subject: [PATCH] =?UTF-8?q?Reindaxece=20fulltextu=20se=20spou=C5=A1t=C3=AD?= =?UTF-8?q?=20asynchronn=C4=9B-=20rychlej=C5=A1=C3=AD=20start=20aplikace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../isspst/services/FullTextServiceImpl.java | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/main/java/info/bukova/isspst/services/FullTextServiceImpl.java b/src/main/java/info/bukova/isspst/services/FullTextServiceImpl.java index 12dee947..c2583459 100644 --- a/src/main/java/info/bukova/isspst/services/FullTextServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/FullTextServiceImpl.java @@ -5,17 +5,6 @@ import info.bukova.isspst.dao.QueryDao; import info.bukova.isspst.data.BaseData; import info.bukova.isspst.data.User; import info.bukova.isspst.sort.ReflectionTools; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import org.apache.lucene.search.Query; import org.hibernate.Hibernate; import org.hibernate.search.FullTextSession; @@ -28,6 +17,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.transaction.annotation.Transactional; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.*; + public class FullTextServiceImpl implements FullTextService { @Autowired @@ -48,11 +43,7 @@ public class FullTextServiceImpl implements FullTextService { Logger logger = LoggerFactory.getLogger(FullTextServiceImpl.class); logger.info("Indexing database for fulltext search"); FullTextSession ftSession = Search.getFullTextSession(queryDao.getSession()); - try { - ftSession.createIndexer().startAndWait(); - } catch (InterruptedException e) { - logger.error("Cannot index database"); - } + ftSession.createIndexer().start(); } @Override