Package org.apache.solr.core

Examples of org.apache.solr.core.SolrConfig$HttpCachingConfig


    final String xslt = request.getParams().get(TRANSFORM_PARAM,null);
    if(xslt==null) {
      throw new IOException("'" + TRANSFORM_PARAM + "' request parameter is required to use the XSLTResponseWriter");
    }
    // not the cleanest way to achieve this
    SolrConfig solrConfig = request.getSearcher().getSchema().getSolrConfig();
    // no need to synchronize access to context, right?
    // Nothing else happens with it at the same time
    final Map<Object,Object> ctx = request.getContext();
    Transformer result = (Transformer)ctx.get(CONTEXT_TRANSFORMER_KEY);
    if(result==null) {
View Full Code Here


     * Load a {@code SolrConfig} from ZooKeeper.
     * <p>
     * The returned SolrConfig will include this instance as its {@code SolrResourceLoader}.
     */
    public SolrConfig loadSolrConfig() throws ParserConfigurationException, IOException, SAXException {
        return new SolrConfig(this, SolrConfig.DEFAULT_CONF_FILE, null);
    }
View Full Code Here

      }
     
      LOG.debug("SolrLocator loading IndexSchema from dir {}", mySolrHomeDir);
      try {
        SolrResourceLoader loader = new SolrResourceLoader(mySolrHomeDir);
        SolrConfig solrConfig = new SolrConfig(loader, "solrconfig.xml", null);
       
        IndexSchema schema = IndexSchemaFactory.buildIndexSchema("schema.xml", solrConfig);
        validateSchema(schema);
        return schema;
      } catch (ParserConfigurationException e) {
View Full Code Here

    }
   
    LOG.debug("SolrLocator loading IndexSchema from dir {}", mySolrHomeDir);
    try {
      SolrResourceLoader loader = new SolrResourceLoader(mySolrHomeDir);
      SolrConfig solrConfig = new SolrConfig(loader, "solrconfig.xml", null);
      InputSource is = new InputSource(loader.openSchema("schema.xml"));
      is.setSystemId(SystemIdResolver.createSystemIdFromResourceName("schema.xml"));
     
      IndexSchema schema = new IndexSchema(solrConfig, "schema.xml", is);
      validateSchema(schema);
View Full Code Here

     * @return EmbeddedSolrServer: The instantiated server
     * @throws Exception if any errors occur
     */
    private EmbeddedSolrServer startSolr(String home) throws Exception {
        try {
            SolrConfig solrConfig = new SolrConfig(home, SOLR_CONFIG, null);
            IndexSchema schema = new IndexSchema(solrConfig, SOLR_SCHEMA, null);

            solrContainer = new CoreContainer(new SolrResourceLoader(
                    SolrResourceLoader.locateSolrHome()));
            CoreDescriptor descriptor = new CoreDescriptor(solrContainer, "",
                    solrConfig.getResourceLoader().getInstanceDir());
            descriptor.setConfigName(solrConfig.getResourceName());
            descriptor.setSchemaName(schema.getResourceName());

            solrCore = new SolrCore(null, solrConfig.getDataDir(),
                    solrConfig, schema, descriptor);
            solrContainer.register("", solrCore, false);
            return new EmbeddedSolrServer(solrContainer, "");
        } catch(Exception ex) {
            log.error("\nFailed to start Solr server\n");
View Full Code Here

     * @param home: The path to the Solr home directory
     * @return EmbeddedSolrServer: The instantiated server
     * @throws Exception if any errors occur
     */
    private EmbeddedSolrServer startSolr(String home) throws Exception {
        SolrConfig solrConfig = new SolrConfig(home, SOLR_CONFIG, null);
        IndexSchema schema = new IndexSchema(solrConfig, SOLR_SCHEMA, null);

        solrContainer = new CoreContainer(new SolrResourceLoader(
                SolrResourceLoader.locateSolrHome()));
        CoreDescriptor descriptor = new CoreDescriptor(solrContainer, "",
                solrConfig.getResourceLoader().getInstanceDir());
        descriptor.setConfigName(solrConfig.getResourceName());
        descriptor.setSchemaName(schema.getResourceName());

        SolrCore solrCore = new SolrCore(null, solrConfig.getDataDir(),
                solrConfig, schema, descriptor);
        solrContainer.register("", solrCore, false);
        return new EmbeddedSolrServer(solrContainer, "");
    }
View Full Code Here

TOP

Related Classes of org.apache.solr.core.SolrConfig$HttpCachingConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.