use of org.structr.common.fulltext.FulltextIndexer in project structr by structr.
the class FeedItemContent method updateIndex.
static void updateIndex(final Indexable thisIndexable, final SecurityContext securityContext) {
try {
final FulltextIndexer indexer = StructrApp.getInstance(securityContext).getFulltextIndexer();
indexer.addToFulltextIndex(thisIndexable);
} catch (FrameworkException fex) {
logger.warn("Unable to index {}: {}", thisIndexable, fex.getMessage());
}
}
use of org.structr.common.fulltext.FulltextIndexer in project structr by structr.
the class File method notifyUploadCompletion.
static void notifyUploadCompletion(final File thisFile) {
try {
try (final Tx tx = StructrApp.getInstance().tx()) {
synchronized (tx) {
FileHelper.updateMetadata(thisFile, true);
tx.success();
}
}
final FulltextIndexer indexer = StructrApp.getInstance(thisFile.getSecurityContext()).getFulltextIndexer();
indexer.addToFulltextIndex(thisFile);
} catch (FrameworkException fex) {
logger.warn("Unable to index {}: {}", thisFile, fex.getMessage());
}
}
use of org.structr.common.fulltext.FulltextIndexer in project structr by structr.
the class StructrApp method getFulltextIndexer.
@Override
public FulltextIndexer getFulltextIndexer(final Object... params) {
final Map<String, StructrModule> modules = StructrApp.getConfiguration().getModules();
final StructrModule module = modules.get("text-search");
if (module != null && module instanceof FulltextIndexer) {
return (FulltextIndexer) module;
}
return new DummyFulltextIndexer();
}
Aggregations