Package org.apache.solr.core

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


    }
   
    // Initialize
    try {
      CoreContainer cores = new CoreContainer(new SolrResourceLoader(instanceDir));
      SolrConfig solrConfig = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
      CoreDescriptor dcore = new CoreDescriptor(cores, "", solrConfig.getResourceLoader().getInstanceDir());
      IndexSchema indexSchema = new IndexSchema(solrConfig, instanceDir+"/conf/schema.xml", null);
      core = new SolrCore( null, dataDir, solrConfig, indexSchema, dcore);
      cores.register("", core, false);
      parser = new SolrRequestParsers( solrConfig );
    }
View Full Code Here


  public static SolrConfig createConfig(String confFile) {
      // set some system properties for use by tests
      System.setProperty("solr.test.sys.prop1", "propone");
      System.setProperty("solr.test.sys.prop2", "proptwo");
      try {
      return new SolrConfig(confFile);
      }
      catch(Exception xany) {
        throw new RuntimeException(xany);
      }
  }
View Full Code Here

    reader = r;
    searcher = new IndexSearcher(r);
    this.closeReader = closeReader;
    searcher.setSimilarity(schema.getSimilarity());

    SolrConfig solrConfig = schema.getSolrConfig();
    queryResultWindowSize = solrConfig.queryResultWindowSize;
    queryResultMaxDocsCached = solrConfig.queryResultMaxDocsCached;
    useFilterForSortedQuery = solrConfig.useFilterForSortedQuery;
    enableLazyFieldLoading = solrConfig.enableLazyFieldLoading;
   
View Full Code Here

            throw new RuntimeException("Can't load spell checker: " + className);
          }
        }
     }
      String xpath = "queryConverter";
      SolrConfig solrConfig = core.getSolrConfig();
      NodeList nodes = (NodeList) solrConfig.evaluate(xpath, XPathConstants.NODESET);

      Map<String, QueryConverter> queryConverters = new HashMap<String, QueryConverter>();
      NamedListPluginLoader<QueryConverter> loader =
              new NamedListPluginLoader<QueryConverter>("[solrconfig.xml] " + xpath, queryConverters);

      loader.load(solrConfig.getResourceLoader(), nodes);

      //ensure that there is at least one query converter defined
      if (queryConverters.size() == 0) {
        LOG.warning("No queryConverter defined, using default converter");
        queryConverters.put("queryConverter", new SpellingQueryConverter());
View Full Code Here

    catch(Exception e){
      log.error(e.getMessage()+", defaulting to "+DefaultSimilarity.class,e);
      similarity = new DefaultSimilarity();
    }
   
    SolrConfig config = core.getSolrConfig();
 
    int batchSize = config.getInt("zoie.batchSize",1000);
    long batchDelay = config.getInt("zoie.batchDelay",300000);
    boolean realtime = config.getBool("zoie.realtime", true);
   
   
    _zoieSystem = new ZoieSystem<IndexReader,DocumentWithID>(idxFile,new ZoieSolrIndexableInterpreter(),new DefaultIndexReaderDecorator(),analyzer,similarity,batchSize,batchDelay,realtime);
   
    log.info("Zoie System loaded with: ");
View Full Code Here

    }

    this.closeReader = closeReader;
    setSimilarity(schema.getSimilarity());

    SolrConfig solrConfig = core.getSolrConfig();
    queryResultWindowSize = solrConfig.queryResultWindowSize;
    queryResultMaxDocsCached = solrConfig.queryResultMaxDocsCached;
    useFilterForSortedQuery = solrConfig.useFilterForSortedQuery;
    enableLazyFieldLoading = solrConfig.enableLazyFieldLoading;
   
View Full Code Here

    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.getCore().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

  public static SolrConfig createConfig(String confFile) {
      // set some system properties for use by tests
      System.setProperty("solr.test.sys.prop1", "propone");
      System.setProperty("solr.test.sys.prop2", "proptwo");
      try {
      return new SolrConfig(confFile);
      }
      catch(Exception xany) {
        throw new RuntimeException(xany);
      }
  }
View Full Code Here

            } else {
                File idir = new File(dcore.getInstanceDir());
                String instanceDir = idir.getPath();
                SolrResourceLoader loader = new OsgiSolrResourceLoader(context, instanceDir,
                    CoreContainer.class.getClassLoader());
                SolrConfig config;
                try {
                    config = new SolrConfig(loader, dcore.getConfigName(), null);
                } catch (Exception e) {
                    log.error("Failed to load file {}", new File(instanceDir, dcore.getConfigName()).getAbsolutePath());
                    throw new SolrException(ErrorCode.SERVER_ERROR, "Could not load config for " + dcore.getConfigName(), e);
                }
                IndexSchema schema = null;
View Full Code Here

        throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, "can not find logging file: "+loggingConfig );
      }
    }
   
    // Initialize SolrConfig
    SolrConfig config = null;
    try {
      config = new SolrConfig(instanceDir, SolrConfig.DEFAULT_CONF_FILE, null);
      instanceDir = config.getResourceLoader().getInstanceDir();

      // If the Data directory is specified, initialize SolrCore directly
      IndexSchema schema = new IndexSchema(config, instanceDir+"/conf/schema.xml", null);
      core = new SolrCore( null, dataDir, config, schema, null );
      parser = new SolrRequestParsers( config );
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.