Examples of EmbeddedSolrServer


Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

        CoreContainer coreContainer = new CoreContainer(solrFolder.getAbsolutePath(), solrFile);
        CoreDescriptor coreDescriptor = new CoreDescriptor(coreContainer, coreId,
                solrCoreFolder.getAbsolutePath());
        SolrCore core = coreContainer.create(coreDescriptor);
        coreContainer.register(coreId, core, true);
        return new EmbeddedSolrServer(coreContainer, coreId);
    }
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

                // managedSolrServer
                classifier.bindManagedSolrServer(managedSolrServer);
                classifier.activate(context, getCanonicalConfiguration(engineName + "-evaluation"));
            } else {
                // non-OSGi runtime, need to do the setup manually
                EmbeddedSolrServer evaluationServer = EmbeddedSolrHelper.makeEmbeddedSolrServer(tmpfolder,
                    "evaluationclassifierserver", "default-topic-model", "default-topic-model");
                classifier.configure(getCanonicalConfiguration(evaluationServer));
            }
        } catch (Exception e) {
            throw new ClassifierException(e);
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

              
               File h = new File(home);
                 File f = new File( h, "solr.xml" );
                 CoreContainer container = new CoreContainer(home);
                 container.load( home, f );
                 server = new EmbeddedSolrServer( container, this.coreName );
             }
            
             if (server==null) return false;

            return true;
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

    try {
      heartBeater.needHeartBeat();

      Path solrHomeDir = SolrRecordWriter.findSolrConfig(conf);
      FileSystem fs = outputShardDir.getFileSystem(conf);
      EmbeddedSolrServer solr = createEmbeddedSolrServer(solrHomeDir, fs, outputShardDir);
      batchWriter = new BatchWriter(solr, batchSize,
          context.getTaskAttemptID().getTaskID(),
          SolrOutputFormat.getSolrWriterThreadCount(conf),
          SolrOutputFormat.getSolrWriterQueueSize(conf));
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

              + HdfsDirectoryFactory.class.getSimpleName());
    }

    container.register(core, false);

    EmbeddedSolrServer solr = new EmbeddedSolrServer(container, "core1");
    return solr;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

    long actualDocs = 0;
    int actualShards = 0;
    for (FileStatus dir : fs.listStatus(outDir)) { // for each shard
      if (dir.getPath().getName().startsWith("part") && dir.isDirectory()) {
        actualShards++;
        EmbeddedSolrServer solr = SolrRecordWriter.createEmbeddedSolrServer(
            new Path(solrHomeDir.getAbsolutePath()), fs, dir.getPath());
       
        try {
          SolrQuery query = new SolrQuery();
          query.setQuery("*:*");
          QueryResponse resp = solr.query(query);
          long numDocs = resp.getResults().getNumFound();
          actualDocs += numDocs;
        } finally {
          solr.shutdown();
        }
      }
    }
    assertEquals(expectedShards, actualShards);
    assertEquals(expectedDocs, actualDocs);
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

    return localServer;
  }

  private LocalSolrServer createLocalSolrServer(final String coreName) {
    final SolrCore solrCore = coreContainer.getCore(coreName);
    final EmbeddedSolrServer solrServer = new EmbeddedSolrServer(coreContainer, coreName);

    return new LocalSolrServer(solrServer, solrCore);
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

   * @throws UnsupportedCoreException
   */
  private LocalSolrServer createLocalSolrServer(final String coreName) throws UnsupportedCoreException {
    logger.log(Level.INFO, "Creating local solr server '" + coreName + "'");
    final SolrCore solrCore = getCoreContainer(coreName).getCore(coreName);
    final EmbeddedSolrServer solrServer = new EmbeddedSolrServer(coreContainer, coreName);

    logger.log(Level.INFO, "Created local solr server '" + coreName + "'");
    return new LocalSolrServer(solrServer, solrCore);
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

   * @Constructor
   * construct a proxy to a local Solr server
   * @param coreName the Solr core name
   */
  public SolrProxy(String coreName) {
    solrServer = new EmbeddedSolrServer(coreContainer, coreName);
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer

        try {
            coreContainer.load();
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.