<commit_before>/*******************************************************************************
 * Copyright 2015 EMBL - European Bioinformatics Institute
 *
 * Licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the
 * License.
 *******************************************************************************/

package org.mousephenotype.cda.indexers;

import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.mousephenotype.cda.db.dao.GwasDAO;
import org.mousephenotype.cda.db.dao.GwasDTO;
import org.mousephenotype.cda.indexers.beans.AutosuggestBean;
import org.mousephenotype.cda.indexers.beans.SangerGeneBean;
import org.mousephenotype.cda.indexers.exceptions.IndexerException;
import org.mousephenotype.cda.solr.service.dto.*;
import org.mousephenotype.cda.utilities.RunStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.sql.SQLException;
import java.util.*;

@EnableAutoConfiguration
public class AutosuggestIndexer extends AbstractIndexer implements CommandLineRunner {

	private final Logger logger = LoggerFactory.getLogger(AutosuggestIndexer.class);


//	@NotNull
//    @Value("${phenodigm.solrserver}")
//    private String phenodigmSolrServer;

    @Autowired
    @Qualifier("phenodigmIndexing")
    private SolrServer phenodigmCore;

    @Autowired
    @Qualifier("autosuggestIndexing")
    private SolrClient autosuggestCore;

    @NotNull
    @Value("${imits.solr.host}")
    private String imitsSolrHost;

    @Autowired
    @Qualifier("geneCore")
    private SolrClient geneCore;

    @Autowired
    @Qualifier("mpCore")
    private SolrClient mpCore;

    @Autowired
    @Qualifier("diseaseCore")
    private SolrClient diseaseCore;

    @Autowired
    @Qualifier("anatomyCore")
    private SolrClient anatomyCore;

	@Autowired
	@Qualifier("phenodigmCore")
	private SolrClient phenodigmCore;

	@Autowired
   	private GwasDAO gwasDao;

    private SolrServer sangerAlleleCore;

    public static final long MIN_EXPECTED_ROWS = 218000;
    public static final int PHENODIGM_CORE_MAX_RESULTS = 350000;

    // Sets used to insure uniqueness when loading core components.

    // gene
    Set<String> mgiAccessionIdSet = new HashSet();
    Set<String> mgiAlleleAccessionIdSet = new HashSet();
    Set<String> markerSymbolSet = new HashSet();
    Set<String> markerNameSet = new HashSet();
    Set<String> markerSynonymSet = new HashSet();
    Set<String> humanGeneSymbolSet = new HashSet();

    // mp
    Set<String> mpIdSet = new HashSet();
    Set<String> mpTermSet = new HashSet();
    Set<String> mpTermSynonymSet = new HashSet();
    Set<String> mpAltIdSet = new HashSet();

    // disease
    Set<String> diseaseIdSet = new HashSet();
    Set<String> diseaseTermSet = new HashSet();
    Set<String> diseaseAltsSet = new HashSet();<commit_msg>- fixed redundant server variables<commit_after>/*******************************************************************************
 * Copyright 2015 EMBL - European Bioinformatics Institute
 *
 * Licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the
 * License.
 *******************************************************************************/

package org.mousephenotype.cda.indexers;

import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.mousephenotype.cda.db.dao.GwasDAO;
import org.mousephenotype.cda.db.dao.GwasDTO;
import org.mousephenotype.cda.indexers.beans.AutosuggestBean;
import org.mousephenotype.cda.indexers.beans.SangerGeneBean;
import org.mousephenotype.cda.indexers.exceptions.IndexerException;
import org.mousephenotype.cda.solr.service.dto.*;
import org.mousephenotype.cda.utilities.RunStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.sql.SQLException;
import java.util.*;

@EnableAutoConfiguration
public class AutosuggestIndexer extends AbstractIndexer implements CommandLineRunner {

	private final Logger logger = LoggerFactory.getLogger(AutosuggestIndexer.class);


    @Autowired
    @Qualifier("autosuggestIndexing")
    private SolrClient autosuggestCore;

    @NotNull
    @Value("${imits.solr.host}")
    private String imitsSolrHost;

    @Autowired
    @Qualifier("geneCore")
    private SolrClient geneCore;

    @Autowired
    @Qualifier("mpCore")
    private SolrClient mpCore;

    @Autowired
    @Qualifier("diseaseCore")
    private SolrClient diseaseCore;

    @Autowired
    @Qualifier("anatomyCore")
    private SolrClient anatomyCore;

	@Autowired
	@Qualifier("phenodigmCore")
	private SolrClient phenodigmCore;

	@Autowired
   	private GwasDAO gwasDao;

    private SolrClient sangerAlleleCore;

    public static final long MIN_EXPECTED_ROWS = 218000;
    public static final int PHENODIGM_CORE_MAX_RESULTS = 350000;

    // Sets used to insure uniqueness when loading core components.

    // gene
    Set<String> mgiAccessionIdSet = new HashSet();
    Set<String> mgiAlleleAccessionIdSet = new HashSet();
    Set<String> markerSymbolSet = new HashSet();
    Set<String> markerNameSet = new HashSet();
    Set<String> markerSynonymSet = new HashSet();
    Set<String> humanGeneSymbolSet = new HashSet();

    // mp
    Set<String> mpIdSet = new HashSet();
    Set<String> mpTermSet = new HashSet();
    Set<String> mpTermSynonymSet = new HashSet();
    Set<String> mpAltIdSet = new HashSet();

    // disease
    Set<String> diseaseIdSet = new HashSet();
    Set<String> diseaseTermSet = new HashSet();
    Set<String> diseaseAltsSet = new HashSet();
{'fraction_non_alphanumeric': 0.12894930198383542, 'fraction_numerical': 0.005388194954690179, 'mean_word_length': 4.987536656891495, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143547', 'n_tokens_mistral': 2471, 'n_tokens_neox': 2366, 'n_words': 565}