Examples of EmbeddedSolrServer


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

      }
      catch( Exception ex ) {
        throw new RuntimeException( ex );
      }
    } else {
      return new EmbeddedSolrServer( h.getCoreContainer(), "" );
    }
  }
View Full Code Here

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

    }

    public static SolrServer createSolrServer() throws Exception {
        CoreContainer coreContainer = new CoreContainer(SOLR_HOME_PATH);
        coreContainer.load(SOLR_HOME_PATH, new File(SOLRCONFIG_PATH));
        return new EmbeddedSolrServer(coreContainer, "oak");
    }
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

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

    }

    System.setProperty("solr.solr.home", solrHome.getPath());
    CoreContainer.Initializer initializer = new CoreContainer.Initializer();
    CoreContainer coreContainer = initializer.initialize();
    this.server = new EmbeddedSolrServer(coreContainer, "");
    //    this.server = new CommonsHttpSolrServer(url);
    //    if(url.startsWith("https")){
    //      //here we use server credentials to setup https
    //      enableSecurity();
    //    }
View Full Code Here

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

    // create a new instance.  But for now the implementation simply
    // uses QueryResponse, and if it chokes in a known way, fall back
    // to bare bones SolrResponseBase.
    // TODO: Can this writer know what the handler class is?  With echoHandler=true it can get its string name at least
    SolrResponse rsp = new QueryResponse();
    NamedList<Object> parsedResponse = new EmbeddedSolrServer(request.getCore()).getParsedResponse(request, response);
    try {
      rsp.setResponse(parsedResponse);

      // page only injected if QueryResponse works
      context.put("page",new PageTool(request,response))// page tool only makes sense for a SearchHandler request... *sigh*
 
View Full Code Here

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

            }
        } else {
            server = (CoreContainer)service;
            coreName = this.coreName;
        }
        return new EmbeddedSolrServer(server, coreName);
    }
View Full Code Here

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

      CoreDescriptor descr = new CoreDescriptor(container, "core1", solrHome.toString());
      descr.setDataDir(dataDir);
      descr.setCoreProperties(props);
      core = container.create(descr);
      container.register(core, false);
      solr = new EmbeddedSolrServer(container, "core1");
      batchWriter = new BatchWriter(solr, batchSize, context.getTaskAttemptID().getTaskID(), threadCount, queueSize);

      this.converter = converter;
    } catch(Exception e) {
      throw new IllegalStateException(String.format("Failed to initialize record writer for %s, %s",
View Full Code Here

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

        SolrResourceLoader loader = new SolrResourceLoader("solr");
        CoreContainer container = new CoreContainer(loader);
        CoreDescriptor descriptor = new CoreDescriptor(container, "cname", ".");
        SolrCore core = container.create(descriptor);
        container.register(core.getName(), core, false);
        this.solr = new EmbeddedSolrServer(container, core.getName());
    }
View Full Code Here

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

      /* create a Solr instance to check document has been indexed as expected */
      URL solrURL = this.getClass().getResource("/org/apache/uima/solrcas/");
      System.setProperty("solr.solr.home", new File(solrURL.toURI()).getAbsolutePath());
      CoreContainer.Initializer initializer = new CoreContainer.Initializer();
      CoreContainer coreContainer = initializer.initialize();
      SolrServer solrServer = new EmbeddedSolrServer(coreContainer, "");

      ModifiableSolrParams solrParams = new ModifiableSolrParams();
      solrParams.add("q", "annotation:Francesco");
      QueryResponse queryResponse = solrServer.query(solrParams);

      /* check the result contains only one doc with 2 annotations of the mock CAS */
      assertTrue(queryResponse != null);
      SolrDocumentList results = queryResponse.getResults();
      assertTrue(results.getNumFound() == 1);
View Full Code Here

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

      if (solrInstanceTypeParam.equals("embedded")) {
        URI solrURI = getURI(solrPathParam);
        System.setProperty("solr.solr.home", new File(solrURI).getAbsolutePath());
        CoreContainer.Initializer initializer = new CoreContainer.Initializer();
        CoreContainer coreContainer = initializer.initialize();
        solrServer = new EmbeddedSolrServer(coreContainer, "");
      }
    } catch (Exception e){
      throw new SolrServerException(e);
    }
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.