You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Dino Di Cola <di...@gmail.com> on 2010/03/10 15:05:39 UTC

embedded server / servlet container

Dear all,
I am trying to provide an embedded server to a web application deployed in a
servlet container (like tomcat).
I would like to call a method like this

    protected void configSolrServer() throws ConfigException {
        String idxHome =
systemProp.getProperty(Configuration.Key.IDX_HOME);
        System.setProperty(Configuration.Key.SOLR_HOME, idxHome );
        CoreContainer.Initializer initializer = new
CoreContainer.Initializer();
        CoreContainer coreContainer;

        try {
            coreContainer = initializer.initialize();
        } catch (IOException e) {
            throw new ConfigException(e);
        } catch (ParserConfigurationException e) {
            throw new ConfigException(e);
        } catch (SAXException e) {
            throw new ConfigException(e);
        }
        solrServer = new EmbeddedSolrServer(coreContainer, "");
    }

inside a factory implementation injected as the ServletContextListener
contextInitialized() method is called.
Are there problems if the Embedded Server is configured as slave and is
polling a master to implement index replication?
In particular, I have doubts with respect to container thread handling (I
saw different thread pool started during index replication polling).

Sorry if the question is closer to servlet container behaviour than solr
server.
Any help is really appreciated.
Thanks,
Dino.
--

Re: embedded server / servlet container

Posted by Dino Di Cola <di...@gmail.com>.
Hi all.
Anyone involved in a configuration like this?
Or is it a wrong approach or the wrong place to ask for?
Thanks in advance,
Dino.
--

2010/3/10 Dino Di Cola <di...@gmail.com>

> Dear all,
> I am trying to provide an embedded server to a web application deployed in
> a servlet container (like tomcat).
> I would like to call a method like this
>
>     protected void configSolrServer() throws ConfigException {
>         String idxHome =
> systemProp.getProperty(Configuration.Key.IDX_HOME);
>         System.setProperty(Configuration.Key.SOLR_HOME, idxHome );
>         CoreContainer.Initializer initializer = new
> CoreContainer.Initializer();
>         CoreContainer coreContainer;
>
>         try {
>             coreContainer = initializer.initialize();
>         } catch (IOException e) {
>             throw new ConfigException(e);
>         } catch (ParserConfigurationException e) {
>             throw new ConfigException(e);
>         } catch (SAXException e) {
>             throw new ConfigException(e);
>         }
>         solrServer = new EmbeddedSolrServer(coreContainer, "");
>     }
>
> inside a factory implementation injected as the ServletContextListener
> contextInitialized() method is called.
> Are there problems if the Embedded Server is configured as slave and is
> polling a master to implement index replication?
> In particular, I have doubts with respect to container thread handling (I
> saw different thread pool started during index replication polling).
>
> Sorry if the question is closer to servlet container behaviour than solr
> server.
> Any help is really appreciated.
> Thanks,
> Dino.
> --
>
>
>
>
>
>
>

Re: embedded server / servlet container

Posted by Arjun Dhar <dh...@yahoo.com>.
Hi I was looking for info on the embedded server too.

So there is no pure API version as a dependency that I can control and run
via the webapp code?
Solr is so popular, I'd assume also it has a JMX enabled API. I should not
have the need for JSPs, servlets etc if I want to index, query and integrate
with any application API.

Please let me know if this assumption is wrong. I'd expect the above from
any popular modern search framework.

thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/embedded-server-servlet-container-tp474537p3816892.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: embedded server / servlet container

Posted by Dennis Gearon <ge...@sbcglobal.net>.
How would that work in a PHP environment. I've already come to my own conclusion that using the JSON output would be safer (definitely) and faster (probably) than using PHP output and eval(); 

So what to do when it gets to the PHP process is no problem. But it's setting up an embedded server on a shared host that I'm working on. I assume that use PHP to access the localhost port for SOLR once I get it all going.


Dennis Gearon

Signature Warning
----------------
EARTH has a Right To Life,
  otherwise we all die.

Read 'Hot, Flat, and Crowded'
Laugh at http://www.yert.com/film.php


--- On Thu, 3/11/10, Chris Hostetter <ho...@fucit.org> wrote:

> From: Chris Hostetter <ho...@fucit.org>
> Subject: Re: embedded server / servlet container
> To: solr-user@lucene.apache.org
> Date: Thursday, March 11, 2010, 9:24 AM
> 
> : I am trying to provide an embedded server to a web
> application deployed in a
> : servlet container (like tomcat).
> 
> If you are trying to use Solr inside another webapp, my
> suggestion would 
> just be to incorporate the existing Solr servlets, jsps,
> dispatch filter, 
> and web.xml specifics from solr inot your app, and let them
> do their own 
> thing -- it's going to make your life much easier from an
> "upgrade" 
> standpoint.
> 
> Better still: run solr.war as it's own webapp in the same
> servlet 
> container.
> 
> 
> -Hoss
> 
> 

Re: embedded server / servlet container

Posted by Chris Hostetter <ho...@fucit.org>.
: I am trying to provide an embedded server to a web application deployed in a
: servlet container (like tomcat).

If you are trying to use Solr inside another webapp, my suggestion would 
just be to incorporate the existing Solr servlets, jsps, dispatch filter, 
and web.xml specifics from solr inot your app, and let them do their own 
thing -- it's going to make your life much easier from an "upgrade" 
standpoint.

Better still: run solr.war as it's own webapp in the same servlet 
container.


-Hoss