use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.
the class IndexServiceImpl method indexGenes.
@Override
public String indexGenes() {
IndexerTaskCommand command = new IndexerTaskCommand();
command.setIndexGene(true);
return taskRunningService.submitLocalTask(new IndexerJob(command));
}
use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.
the class IndexServiceImpl method indexAll.
@Override
public String indexAll() {
IndexerTaskCommand command = new IndexerTaskCommand();
command.setAll(true);
return taskRunningService.submitLocalTask(new IndexerJob(command));
}
use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.
the class IndexServiceImpl method indexExpressionExperiments.
@Override
public String indexExpressionExperiments() {
IndexerTaskCommand command = new IndexerTaskCommand();
command.setIndexEE(true);
return taskRunningService.submitLocalTask(new IndexerJob(command));
}
use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.
the class SearchServiceTest method testSearchByBibRefId.
@Test
public void testSearchByBibRefId() {
try {
this.setup();
} catch (Exception e) {
e.printStackTrace();
}
String id;
if (ee.getPrimaryPublication() == null) {
PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
BibliographicReference bibref = fetcher.retrieveByHTTP(21878914);
bibref = (BibliographicReference) persisterHelper.persist(bibref);
ee.setPrimaryPublication(bibref);
eeService.update(ee);
id = "21878914";
} else {
id = ee.getPrimaryPublication().getPubAccession().getAccession();
}
log.info("indexing ...");
IndexerTaskCommand c = new IndexerTaskCommand();
c.setIndexBibRef(true);
indexerTask.setTaskCommand(c);
indexerTask.execute();
SearchSettings settings = SearchSettings.Factory.newInstance();
settings.noSearches();
settings.setQuery(id);
settings.setSearchExperiments(true);
settings.setUseCharacteristics(false);
Map<Class<?>, List<SearchResult>> found = this.searchService.search(settings);
assertTrue(!found.isEmpty());
for (SearchResult sr : found.get(ExpressionExperiment.class)) {
if (sr.getResultObject().equals(ee)) {
this.tearDown();
return;
}
}
this.tearDown();
fail("Didn't get expected result from search");
}
use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.
the class SearchServiceTest method testSearchByBibRefIdProblemsB.
@Test
public void testSearchByBibRefIdProblemsB() {
try {
this.setup();
} catch (Exception e) {
e.printStackTrace();
}
PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
BibliographicReference bibref = fetcher.retrieveByHTTP(22780917);
bibref = (BibliographicReference) persisterHelper.persist(bibref);
assertTrue(bibref.getAbstractText().contains("d to chromosome 22q12. Our results confirm chromosome 22q12 as the solitary locus for FFEVF"));
IndexerTaskCommand c = new IndexerTaskCommand();
c.setIndexBibRef(true);
indexerTask.setTaskCommand(c);
indexerTask.execute();
SearchSettings settings = SearchSettings.Factory.newInstance();
settings.noSearches();
settings.setQuery("confirm chromosome 22q12");
settings.setSearchBibrefs(true);
Map<Class<?>, List<SearchResult>> found = this.searchService.search(settings);
assertTrue(!found.isEmpty());
for (SearchResult sr : found.get(BibliographicReference.class)) {
if (sr.getResultObject().equals(bibref)) {
this.tearDown();
return;
}
}
this.tearDown();
fail("Didn't get expected result from search");
}
Aggregations