Skip to content

Commit

Permalink
implementation search method
Browse files Browse the repository at this point in the history
Issue imixs#554
  • Loading branch information
rsoika committed Aug 31, 2019
1 parent 3aac592 commit 9040f47
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public class JSONParser {
* @return - the json value or the json object for the corresponding json key
*/
public static String getKey(String key, String json) {
if (json==null || json.isEmpty()) {
return null;
}
String result = null;
// now extract the key
JsonParser parser = Json.createParser(new StringReader(json));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import javax.annotation.Resource;
import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RunAs;
import javax.ejb.EJB;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.ejb.Timer;
Expand Down Expand Up @@ -154,12 +153,6 @@ public void startup() {
}
}

// migrate old workflow scheduler
migrateWorkflowScheduler();

// next start optional schedulers
logger.info("...initalizing schedulers...");
schedulerService.startAllSchedulers();

// Finally fire the SetupEvent. This allows CDI Observers to react on the setup
if (setupEvents != null) {
Expand All @@ -170,6 +163,16 @@ public void startup() {
logger.warning("Missing CDI support for Event<SetupEvent> !");
}




// migrate old workflow scheduler
migrateWorkflowScheduler();

// Finally start optional schedulers
logger.info("...initalizing schedulers...");
schedulerService.startAllSchedulers();

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ public class LuceneIndexService {

public static final String ANONYMOUS = "ANONYMOUS";
public static final String DEFAULT_ANALYSER = "org.apache.lucene.analysis.standard.ClassicAnalyzer";
public static final String DEFAULT_INDEX_DIRECTORY = "imixs-workflow-index";


public static final String DEFAULT_INDEX_DIRECTORY = "imixs-workflow-index";

@PersistenceContext(unitName = "org.imixs.workflow.jpa")
private EntityManager manager;
Expand Down Expand Up @@ -228,7 +226,7 @@ public void rebuildIndex(Directory indexDir) throws IOException {
* of ItemCollections to be indexed
* @throws IndexException
*/
public void updateDocumentsUncommitted(Collection<ItemCollection> documents) {
public void indexDocuments(Collection<ItemCollection> documents) {

IndexWriter awriter = null;
long ltime = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.List;
import java.util.logging.Logger;

import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.inject.Inject;

Expand Down Expand Up @@ -70,21 +69,9 @@ public class LuceneUpdateService implements UpdateService {

@Inject
private LuceneIndexService luceneIndexService;


private static Logger logger = Logger.getLogger(LuceneUpdateService.class.getName());

/**
* PostContruct event - The method loads the lucene index properties from the
* imixs.properties file from the classpath. If no properties are defined the
* method terminates.
*
*/
@PostConstruct
void init() {
logger.finest("......lucene IndexDir=" + luceneIndexService.getLuceneIndexDir());
}

/**
* This method adds a collection of documents to the Lucene index. The documents
* are added immediately to the index. Calling this method within a running
Expand All @@ -100,7 +87,7 @@ void init() {
*/
@Override
public void updateIndex(List<ItemCollection> documents) {
luceneIndexService.updateDocumentsUncommitted(documents);
luceneIndexService.indexDocuments(documents);

}

Expand Down
Loading

0 comments on commit 9040f47

Please sign in to comment.