Class EmbeddedSolrServer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CoreContainer coreContainer  
      protected String coreName  
      • Fields inherited from class org.apache.solr.client.solrj.SolrClient

        defaultCollection
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes any resources created by this instance
      CoreContainer getCoreContainer()
      Getter method for the CoreContainer
      org.apache.solr.common.util.NamedList<Object> request​(org.apache.solr.client.solrj.SolrRequest<?> request, String coreName)  
      • Methods inherited from class org.apache.solr.client.solrj.SolrClient

        add, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getBinder, getById, getById, getById, getById, getById, getById, getById, getById, getContext, getDefaultCollection, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback
    • Field Detail

      • coreName

        protected final String coreName
    • Constructor Detail

      • EmbeddedSolrServer

        public EmbeddedSolrServer​(Path solrHome,
                                  String defaultCoreName)
        Create an EmbeddedSolrServer using a given solr home directory
        Parameters:
        solrHome - the solr home directory
        defaultCoreName - the core to route requests to by default (optional)
      • EmbeddedSolrServer

        public EmbeddedSolrServer​(NodeConfig nodeConfig,
                                  String defaultCoreName)
        Create an EmbeddedSolrServer using a NodeConfig
        Parameters:
        nodeConfig - the configuration
        defaultCoreName - the core to route requests to by default (optional)
      • EmbeddedSolrServer

        public EmbeddedSolrServer​(SolrCore core)
        Create an EmbeddedSolrServer wrapping a particular SolrCore
      • EmbeddedSolrServer

        public EmbeddedSolrServer​(CoreContainer coreContainer,
                                  String coreName)
        Create an EmbeddedSolrServer wrapping a CoreContainer.
        Parameters:
        coreContainer - the core container
        coreName - the core to route requests to by default (optional)
      • EmbeddedSolrServer

        public EmbeddedSolrServer​(CoreContainer coreContainer,
                                  String coreName,
                                  EmbeddedSolrServer.RequestWriterSupplier supplier)
        Create an EmbeddedSolrServer wrapping a CoreContainer.
        Parameters:
        coreContainer - the core container
        coreName - the core to route requests to by default
        supplier - the supplier used to create a RequestWriter
    • Method Detail

      • request

        public org.apache.solr.common.util.NamedList<Object> request​(org.apache.solr.client.solrj.SolrRequest<?> request,
                                                                     String coreName)
                                                              throws org.apache.solr.client.solrj.SolrServerException,
                                                                     IOException
        Specified by:
        request in class org.apache.solr.client.solrj.SolrClient
        Throws:
        org.apache.solr.client.solrj.SolrServerException
        IOException
      • close

        public void close()
                   throws IOException
        Closes any resources created by this instance
        Throws:
        IOException
      • getCoreContainer

        public CoreContainer getCoreContainer()
        Getter method for the CoreContainer
        Returns:
        the core container