Search in sources :

Example 6 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class SearchServiceTest method testSearchByBibRefIdProblems.

@Test
public void testSearchByBibRefIdProblems() {
    try {
        this.setup();
    } catch (Exception e) {
        e.printStackTrace();
    }
    PubMedXMLFetcher fetcher = new PubMedXMLFetcher();
    BibliographicReference bibref = fetcher.retrieveByHTTP(9600966);
    bibref = (BibliographicReference) persisterHelper.persist(bibref);
    assertTrue(bibref.getAbstractText().contains("ase proved to be a de novo mutation. In the third kindred, affected brothers both have a"));
    IndexerTaskCommand c = new IndexerTaskCommand();
    c.setIndexBibRef(true);
    indexerTask.setTaskCommand(c);
    indexerTask.execute();
    SearchSettings settings = SearchSettings.Factory.newInstance();
    settings.noSearches();
    settings.setQuery("de novo mutation");
    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");
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand) SearchSettings(ubic.gemma.model.common.search.SearchSettings) PubMedXMLFetcher(ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher) BibliographicReference(ubic.gemma.model.common.description.BibliographicReference) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 7 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexBibliographicReferences.

@Override
public String indexBibliographicReferences() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexBibRef(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 8 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexProbes.

@Override
public String indexProbes() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexProbe(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 9 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexArrayDesigns.

@Override
public String indexArrayDesigns() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexAD(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Example 10 with IndexerTaskCommand

use of ubic.gemma.core.tasks.maintenance.IndexerTaskCommand in project Gemma by PavlidisLab.

the class IndexServiceImpl method indexBioSequences.

@Override
public String indexBioSequences() {
    IndexerTaskCommand command = new IndexerTaskCommand();
    command.setIndexBioSequence(true);
    return taskRunningService.submitLocalTask(new IndexerJob(command));
}
Also used : IndexerTaskCommand(ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)

Aggregations

IndexerTaskCommand (ubic.gemma.core.tasks.maintenance.IndexerTaskCommand)10 Test (org.junit.Test)3 PubMedXMLFetcher (ubic.gemma.core.loader.entrez.pubmed.PubMedXMLFetcher)3 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)3 BibliographicReference (ubic.gemma.model.common.description.BibliographicReference)3 SearchSettings (ubic.gemma.model.common.search.SearchSettings)3