public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { if (ontologiesSolrUrl == null) { throw new NullPointerException("ontologiesSolrUrl is null"); } if (interactionSolrUrl == null) { throw new NullPointerException("interactionsSolrUrl is null"); } if (luceneDirectory == null) { throw new NullPointerException("luceneDirectory is null"); } this.interactionOntologyIndexer = new InteractionOntologyLuceneIndexer(this.ontologiesSolrUrl, this.interactionSolrUrl); this.interactionOntologyIndexer.loadAndIndexAllFacetFieldCounts(new File(luceneDirectory)); this.interactionOntologyIndexer.shutDown(); return RepeatStatus.FINISHED; }
clearpreviousIndex(termIndexWriter); List<String> facetFieldsWithResults = initializeListOfFacetFieldsToRetrieve(); int first = 0; int chunk = 200; Collection<FieldCount> fieldCounts = loadFieldCountsFor(first, chunk, facetFieldsWithResults.toArray(new String[]{}), facetFieldsWithResults); registerFieldCountResultsFor(fieldCounts); first+=chunk; fieldCounts = loadFieldCountsFor(first, chunk, facetFieldsWithResults.toArray(new String[]{}), facetFieldsWithResults); registerFieldCountResultsFor(fieldCounts); System.out.println("Indexing facet fields with ontology terms..."); for (Map.Entry<InteractionOntologyTerm, InteractionOntologyTermResults> termResult : this.processedTerms.entrySet()){ createAndIndexDocumentsFor(termResult.getKey(), termResult.getValue(), termIndexWriter);
private HttpSolrServer createSolrServer(String solrUrl) { HttpSolrServer ontologiesSolrServer = new HttpSolrServer(solrUrl, createHttpClient()); return ontologiesSolrServer; }
LazyLoadedOntologyTerm term = loadOntologyTerm(fieldCount); createAndRegisterInteractionTerm(fieldCount, db, term); for (OntologyTerm parent : parents){ LazyLoadedOntologyTerm lazyParent = (LazyLoadedOntologyTerm) parent; createAndRegisterInteractionTerm(fieldCount, db, lazyParent); try{ createAndRegisterInteractionTerm(fieldCount, db, term); for (OntologyTerm parent : parents){ LazyLoadedOntologyTerm lazyParent = (LazyLoadedOntologyTerm) parent; createAndRegisterInteractionTerm(fieldCount, db, lazyParent);
public InteractionOntologyLuceneIndexer(String ontologySolrUrl, String interactionOntologyUrl) { if (ontologySolrUrl == null){ throw new IllegalArgumentException("The ontology solr url cannot bet null"); } if (interactionOntologyUrl == null){ throw new IllegalArgumentException("The interaction solr url cannot bet null"); } this.ontologySearcher = new OntologySearcher(createSolrServer(ontologySolrUrl)); this.interactionSearcher = new IntactSolrSearcher(createSolrServer(interactionOntologyUrl)); this.processedTerms = new HashMap<InteractionOntologyTerm, InteractionOntologyTermResults>(); }
collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.SPECIES); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.ID, "chebi"); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.DETMETHOD); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.TYPE); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.BIOLOGICAL_ROLE); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTOR_TYPE); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTOR_DET_METHOD); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTION_ANNOTATIONS); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTOR_FEATURE); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTION_XREF, xrefFilters); collectFacetCountsFor(facetFieldCounts, facetCounts, FieldNames.INTERACTOR_XREF, xrefFilters);