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 Robert Krüger <kr...@lesspain.de> on 2015/01/15 15:10:21 UTC

Easiest way to embed solr in a desktop application

Hi,

I have been using an embedded instance of solr in my desktop application
for a long time and it works fine. At the time when I made that decision
(vs. firing up a solr web application within my swing application) I got
the impression embedded use is somewhat unsupported and I should expect
problems.

My first question is, is this still the case now (4 years later), that
embedded solr is discouraged?

The one limitation I am running into is that I cannot use the solr admin UI
for debugging purposes (mainly for running queries). Is there any other way
to do this other than no longer using embedded solr and programmatically
firing up a web application (e.g. using jetty)? Should I do the latter
anyway?

Any insights/advice greatly appreciated.

Best regards,

Robert

Re: Easiest way to embed solr in a desktop application

Posted by Robert Krüger <kr...@lesspain.de>.
Hi Ahmet,

at first glance, I'm not sure. Need to look at it more carefully.

Thanks,

Robert

On Thu, Jan 15, 2015 at 3:53 PM, Ahmet Arslan <io...@yahoo.com.invalid>
wrote:

> Hi Robert,
>
> Never used by myself but is solr-packager useful in your case?
>
> http://sourcesense.github.io/solr-packager/
>
> Ahmet
>
>
> On Thursday, January 15, 2015 4:45 PM, Robert Krüger <kr...@lesspain.de>
> wrote:
> Hi Andrea,
>
> you are assuming correctly. It is a local, non-distributed index that is
> only accessed by the containing desktop application. Do you know if there
> is a possibility to run the Solr admin UI on top of an embedded instance
> somehow?
>
> Thanks a lot,
>
> Robert
>
> On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <a....@gmail.com>
> wrote:
>
> > Hi Robert,
> > I've used the EmbeddedSolrServer in a scenario like that and I never had
> > problems.
> > I assume you're talking about a standalone application, where the whole
> > index resides locally and you don't need any cluster / cloud /
> distributed
> > feature.
> >
> > I think the usage of EmbeddedSolrServer is discouraged in a (distributed)
> > service scenario, because it is a direct connection to a SolrCore
> > instance...but this is not a problem in the situation you described (as
> far
> > as I know)
> >
> > Best,
> > Andrea
> >
> >
> > On 01/15/2015 03:10 PM, Robert Krüger wrote:
> >
> >> Hi,
> >>
> >> I have been using an embedded instance of solr in my desktop application
> >> for a long time and it works fine. At the time when I made that decision
> >> (vs. firing up a solr web application within my swing application) I got
> >> the impression embedded use is somewhat unsupported and I should expect
> >> problems.
> >>
> >> My first question is, is this still the case now (4 years later), that
> >> embedded solr is discouraged?
> >>
> >> The one limitation I am running into is that I cannot use the solr admin
> >> UI
> >> for debugging purposes (mainly for running queries). Is there any other
> >> way
> >> to do this other than no longer using embedded solr and programmatically
> >> firing up a web application (e.g. using jetty)? Should I do the latter
> >> anyway?
> >>
> >> Any insights/advice greatly appreciated.
> >>
> >> Best regards,
>
> >>
> >> Robert
> >>
> >>
> >
>
>
> --
> Robert Krüger
> Managing Partner
> Lesspain GmbH & Co. KG
>
> www.lesspain-software.com
>



-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com

Re: Easiest way to embed solr in a desktop application

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
On 15 January 2015 at 09:53, Ahmet Arslan <io...@yahoo.com.invalid> wrote:
> http://sourcesense.github.io/solr-packager/

Does this work with modern Solr? Seems to be 4-year-old project with
no recent update. Even the parent company seems 'quiet'. But looks
interesting in general.

Regards,
   Alex.
----
Sign up for my Solr resources newsletter at http://www.solr-start.com/

Re: Easiest way to embed solr in a desktop application

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Robert,

Never used by myself but is solr-packager useful in your case?

http://sourcesense.github.io/solr-packager/ 

Ahmet


On Thursday, January 15, 2015 4:45 PM, Robert Krüger <kr...@lesspain.de> wrote:
Hi Andrea,

you are assuming correctly. It is a local, non-distributed index that is
only accessed by the containing desktop application. Do you know if there
is a possibility to run the Solr admin UI on top of an embedded instance
somehow?

Thanks a lot,

Robert

On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <a....@gmail.com>
wrote:

> Hi Robert,
> I've used the EmbeddedSolrServer in a scenario like that and I never had
> problems.
> I assume you're talking about a standalone application, where the whole
> index resides locally and you don't need any cluster / cloud / distributed
> feature.
>
> I think the usage of EmbeddedSolrServer is discouraged in a (distributed)
> service scenario, because it is a direct connection to a SolrCore
> instance...but this is not a problem in the situation you described (as far
> as I know)
>
> Best,
> Andrea
>
>
> On 01/15/2015 03:10 PM, Robert Krüger wrote:
>
>> Hi,
>>
>> I have been using an embedded instance of solr in my desktop application
>> for a long time and it works fine. At the time when I made that decision
>> (vs. firing up a solr web application within my swing application) I got
>> the impression embedded use is somewhat unsupported and I should expect
>> problems.
>>
>> My first question is, is this still the case now (4 years later), that
>> embedded solr is discouraged?
>>
>> The one limitation I am running into is that I cannot use the solr admin
>> UI
>> for debugging purposes (mainly for running queries). Is there any other
>> way
>> to do this other than no longer using embedded solr and programmatically
>> firing up a web application (e.g. using jetty)? Should I do the latter
>> anyway?
>>
>> Any insights/advice greatly appreciated.
>>
>> Best regards,

>>
>> Robert
>>
>>
>


-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com

Re: Easiest way to embed solr in a desktop application

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/15/2015 7:44 AM, Robert Krüger wrote:
> you are assuming correctly. It is a local, non-distributed index that
> is only accessed by the containing desktop application. Do you know
> if there is a possibility to run the Solr admin UI on top of an
> embedded instance somehow?

To have the admin UI, you must have a webserver for a browser to connect
to.  A servlet container (which is a webserver) is required to run Solr
in the traditional way.  If you run it embedded, you give that up.

One of the reasons given by users for running the embedded server is
that the user does not want to deal with the overhead of HTTP.  That
overhead should be fairly minimal on a LAN, especially if that LAN is
gigabit or faster.  A few milliseconds makes very little difference when
it comes to user experience.

Thanks,
Shawn

Re: Easiest way to embed solr in a desktop application

Posted by "Ramkumar R. Aiyengar" <an...@gmail.com>.
That's correct, even though it should still be possible to embed Jetty,
that could change in the future, and that's why support for pluggable
containers is being taken away.

If you need to deal with the index at a lower level, there's always Lucene
you can use as a library instead of Solr.

But I am assuming you need to use the search engine at a higher level than
that and hence you ask for Solr. In which case, I urge you to think through
if you really can't run this out of process, may be this is an XY problem.
Keep in mind that Solr has the ability to provide higher level
functionality because it can control almost the entirety of the application
(which is the philosophical reason behind removal of the war as well), and
that's the reason something like EmbeddedSolrServer will always have
caveats.
On 15 Jan 2015 15:09, "Robert Krüger" <kr...@lesspain.de> wrote:

> I was considering the programmatic Jetty option but then I read that Solr 5
> no longer supports being run with an external servlet container but maybe
> they still support programmatic jetty use in some way. atm I am using solr
> 4.x, so this would work. No idea if this gets messy classloader-wise in any
> way.
>
> I have been using exactly the approach you described in the past, i.e. I
> built a really, really simple swing dialogue to input queries and display
> results in a table but was just guessing that the built-in ui was far
> superior but maybe I should just live with it for the time being.
>
> On Thu, Jan 15, 2015 at 3:56 PM, Erik Hatcher <er...@gmail.com>
> wrote:
>
> > It’d certainly be easiest to just embed Jetty into your application.  You
> > don’t need to have Jetty as a separate process, you could launch it
> through
> > it’s friendly Java API, configured to use solr.war.
> >
> > If all you needed was to make HTTP(-like) queries to Solr instead of the
> > full admin UI, your application could stick to using EmbeddedSolrServer
> and
> > also provide a UI that takes in a Solr query string (or builds one up)
> and
> > then sends it to the embedded Solr and displays the result.
> >
> >         Erik
> >
> > > On Jan 15, 2015, at 9:44 AM, Robert Krüger <kr...@lesspain.de>
> wrote:
> > >
> > > Hi Andrea,
> > >
> > > you are assuming correctly. It is a local, non-distributed index that
> is
> > > only accessed by the containing desktop application. Do you know if
> there
> > > is a possibility to run the Solr admin UI on top of an embedded
> instance
> > > somehow?
> > >
> > > Thanks a lot,
> > >
> > > Robert
> > >
> > > On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <
> a.gazzarini@gmail.com
> > >
> > > wrote:
> > >
> > >> Hi Robert,
> > >> I've used the EmbeddedSolrServer in a scenario like that and I never
> had
> > >> problems.
> > >> I assume you're talking about a standalone application, where the
> whole
> > >> index resides locally and you don't need any cluster / cloud /
> > distributed
> > >> feature.
> > >>
> > >> I think the usage of EmbeddedSolrServer is discouraged in a
> > (distributed)
> > >> service scenario, because it is a direct connection to a SolrCore
> > >> instance...but this is not a problem in the situation you described
> (as
> > far
> > >> as I know)
> > >>
> > >> Best,
> > >> Andrea
> > >>
> > >>
> > >> On 01/15/2015 03:10 PM, Robert Krüger wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> I have been using an embedded instance of solr in my desktop
> > application
> > >>> for a long time and it works fine. At the time when I made that
> > decision
> > >>> (vs. firing up a solr web application within my swing application) I
> > got
> > >>> the impression embedded use is somewhat unsupported and I should
> expect
> > >>> problems.
> > >>>
> > >>> My first question is, is this still the case now (4 years later),
> that
> > >>> embedded solr is discouraged?
> > >>>
> > >>> The one limitation I am running into is that I cannot use the solr
> > admin
> > >>> UI
> > >>> for debugging purposes (mainly for running queries). Is there any
> other
> > >>> way
> > >>> to do this other than no longer using embedded solr and
> > programmatically
> > >>> firing up a web application (e.g. using jetty)? Should I do the
> latter
> > >>> anyway?
> > >>>
> > >>> Any insights/advice greatly appreciated.
> > >>>
> > >>> Best regards,
> > >>>
> > >>> Robert
> > >>>
> > >>>
> > >>
> > >
> > >
> > > --
> > > Robert Krüger
> > > Managing Partner
> > > Lesspain GmbH & Co. KG
> > >
> > > www.lesspain-software.com
> >
> >
>
>
> --
> Robert Krüger
> Managing Partner
> Lesspain GmbH & Co. KG
>
> www.lesspain-software.com
>

Re: Easiest way to embed solr in a desktop application

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/15/2015 8:06 AM, Robert Krüger wrote:
> I was considering the programmatic Jetty option but then I read that Solr 5
> no longer supports being run with an external servlet container but maybe
> they still support programmatic jetty use in some way. atm I am using solr
> 4.x, so this would work. No idea if this gets messy classloader-wise in any
> way.
>
> I have been using exactly the approach you described in the past, i.e. I
> built a really, really simple swing dialogue to input queries and display
> results in a table but was just guessing that the built-in ui was far
> superior but maybe I should just live with it for the time being.

Right now with 5.0 the distinction you're talking about is semantics. 
We will no longer *ship* a war ... but for the immediate future, when
you run Solr, you will still be running jetty, which will then run Solr
as a webapp.  It might still be possible to build a war using the source
code, at least for the immediate future.  I don't know if there will be
a war that you can find within the binary Solr 5.0 download ... I
haven't been involved with the packaging.  The webapp might be fully
exploded rather than packaged in a war.

The bin/solr script that we are using now will handle all the details of
finding and running jetty.  At some point, hopefully soon, Solr will
actually own the network layer, so you (or the bin/solr script) will
actually start Solr as an application.  When we reach that point, Jetty
might be the transport method, but if that's the case, it will be fully
embedded inside Solr.  Currently the Jetty bits in the Solr download are
100% identical to what you can download from eclipse.org.

Thanks,
Shawn


Re: Easiest way to embed solr in a desktop application

Posted by Robert Krüger <kr...@lesspain.de>.
I was considering the programmatic Jetty option but then I read that Solr 5
no longer supports being run with an external servlet container but maybe
they still support programmatic jetty use in some way. atm I am using solr
4.x, so this would work. No idea if this gets messy classloader-wise in any
way.

I have been using exactly the approach you described in the past, i.e. I
built a really, really simple swing dialogue to input queries and display
results in a table but was just guessing that the built-in ui was far
superior but maybe I should just live with it for the time being.

On Thu, Jan 15, 2015 at 3:56 PM, Erik Hatcher <er...@gmail.com>
wrote:

> It’d certainly be easiest to just embed Jetty into your application.  You
> don’t need to have Jetty as a separate process, you could launch it through
> it’s friendly Java API, configured to use solr.war.
>
> If all you needed was to make HTTP(-like) queries to Solr instead of the
> full admin UI, your application could stick to using EmbeddedSolrServer and
> also provide a UI that takes in a Solr query string (or builds one up) and
> then sends it to the embedded Solr and displays the result.
>
>         Erik
>
> > On Jan 15, 2015, at 9:44 AM, Robert Krüger <kr...@lesspain.de> wrote:
> >
> > Hi Andrea,
> >
> > you are assuming correctly. It is a local, non-distributed index that is
> > only accessed by the containing desktop application. Do you know if there
> > is a possibility to run the Solr admin UI on top of an embedded instance
> > somehow?
> >
> > Thanks a lot,
> >
> > Robert
> >
> > On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <a.gazzarini@gmail.com
> >
> > wrote:
> >
> >> Hi Robert,
> >> I've used the EmbeddedSolrServer in a scenario like that and I never had
> >> problems.
> >> I assume you're talking about a standalone application, where the whole
> >> index resides locally and you don't need any cluster / cloud /
> distributed
> >> feature.
> >>
> >> I think the usage of EmbeddedSolrServer is discouraged in a
> (distributed)
> >> service scenario, because it is a direct connection to a SolrCore
> >> instance...but this is not a problem in the situation you described (as
> far
> >> as I know)
> >>
> >> Best,
> >> Andrea
> >>
> >>
> >> On 01/15/2015 03:10 PM, Robert Krüger wrote:
> >>
> >>> Hi,
> >>>
> >>> I have been using an embedded instance of solr in my desktop
> application
> >>> for a long time and it works fine. At the time when I made that
> decision
> >>> (vs. firing up a solr web application within my swing application) I
> got
> >>> the impression embedded use is somewhat unsupported and I should expect
> >>> problems.
> >>>
> >>> My first question is, is this still the case now (4 years later), that
> >>> embedded solr is discouraged?
> >>>
> >>> The one limitation I am running into is that I cannot use the solr
> admin
> >>> UI
> >>> for debugging purposes (mainly for running queries). Is there any other
> >>> way
> >>> to do this other than no longer using embedded solr and
> programmatically
> >>> firing up a web application (e.g. using jetty)? Should I do the latter
> >>> anyway?
> >>>
> >>> Any insights/advice greatly appreciated.
> >>>
> >>> Best regards,
> >>>
> >>> Robert
> >>>
> >>>
> >>
> >
> >
> > --
> > Robert Krüger
> > Managing Partner
> > Lesspain GmbH & Co. KG
> >
> > www.lesspain-software.com
>
>


-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com

Re: Easiest way to embed solr in a desktop application

Posted by Erik Hatcher <er...@gmail.com>.
It’d certainly be easiest to just embed Jetty into your application.  You don’t need to have Jetty as a separate process, you could launch it through it’s friendly Java API, configured to use solr.war.

If all you needed was to make HTTP(-like) queries to Solr instead of the full admin UI, your application could stick to using EmbeddedSolrServer and also provide a UI that takes in a Solr query string (or builds one up) and then sends it to the embedded Solr and displays the result.

	Erik

> On Jan 15, 2015, at 9:44 AM, Robert Krüger <kr...@lesspain.de> wrote:
> 
> Hi Andrea,
> 
> you are assuming correctly. It is a local, non-distributed index that is
> only accessed by the containing desktop application. Do you know if there
> is a possibility to run the Solr admin UI on top of an embedded instance
> somehow?
> 
> Thanks a lot,
> 
> Robert
> 
> On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <a....@gmail.com>
> wrote:
> 
>> Hi Robert,
>> I've used the EmbeddedSolrServer in a scenario like that and I never had
>> problems.
>> I assume you're talking about a standalone application, where the whole
>> index resides locally and you don't need any cluster / cloud / distributed
>> feature.
>> 
>> I think the usage of EmbeddedSolrServer is discouraged in a (distributed)
>> service scenario, because it is a direct connection to a SolrCore
>> instance...but this is not a problem in the situation you described (as far
>> as I know)
>> 
>> Best,
>> Andrea
>> 
>> 
>> On 01/15/2015 03:10 PM, Robert Krüger wrote:
>> 
>>> Hi,
>>> 
>>> I have been using an embedded instance of solr in my desktop application
>>> for a long time and it works fine. At the time when I made that decision
>>> (vs. firing up a solr web application within my swing application) I got
>>> the impression embedded use is somewhat unsupported and I should expect
>>> problems.
>>> 
>>> My first question is, is this still the case now (4 years later), that
>>> embedded solr is discouraged?
>>> 
>>> The one limitation I am running into is that I cannot use the solr admin
>>> UI
>>> for debugging purposes (mainly for running queries). Is there any other
>>> way
>>> to do this other than no longer using embedded solr and programmatically
>>> firing up a web application (e.g. using jetty)? Should I do the latter
>>> anyway?
>>> 
>>> Any insights/advice greatly appreciated.
>>> 
>>> Best regards,
>>> 
>>> Robert
>>> 
>>> 
>> 
> 
> 
> -- 
> Robert Krüger
> Managing Partner
> Lesspain GmbH & Co. KG
> 
> www.lesspain-software.com


Re: Easiest way to embed solr in a desktop application

Posted by Robert Krüger <kr...@lesspain.de>.
Hi Andrea,

you are assuming correctly. It is a local, non-distributed index that is
only accessed by the containing desktop application. Do you know if there
is a possibility to run the Solr admin UI on top of an embedded instance
somehow?

Thanks a lot,

Robert

On Thu, Jan 15, 2015 at 3:17 PM, Andrea Gazzarini <a....@gmail.com>
wrote:

> Hi Robert,
> I've used the EmbeddedSolrServer in a scenario like that and I never had
> problems.
> I assume you're talking about a standalone application, where the whole
> index resides locally and you don't need any cluster / cloud / distributed
> feature.
>
> I think the usage of EmbeddedSolrServer is discouraged in a (distributed)
> service scenario, because it is a direct connection to a SolrCore
> instance...but this is not a problem in the situation you described (as far
> as I know)
>
> Best,
> Andrea
>
>
> On 01/15/2015 03:10 PM, Robert Krüger wrote:
>
>> Hi,
>>
>> I have been using an embedded instance of solr in my desktop application
>> for a long time and it works fine. At the time when I made that decision
>> (vs. firing up a solr web application within my swing application) I got
>> the impression embedded use is somewhat unsupported and I should expect
>> problems.
>>
>> My first question is, is this still the case now (4 years later), that
>> embedded solr is discouraged?
>>
>> The one limitation I am running into is that I cannot use the solr admin
>> UI
>> for debugging purposes (mainly for running queries). Is there any other
>> way
>> to do this other than no longer using embedded solr and programmatically
>> firing up a web application (e.g. using jetty)? Should I do the latter
>> anyway?
>>
>> Any insights/advice greatly appreciated.
>>
>> Best regards,
>>
>> Robert
>>
>>
>


-- 
Robert Krüger
Managing Partner
Lesspain GmbH & Co. KG

www.lesspain-software.com

Re: Easiest way to embed solr in a desktop application

Posted by Andrea Gazzarini <a....@gmail.com>.
Hi Robert,
I've used the EmbeddedSolrServer in a scenario like that and I never had 
problems.
I assume you're talking about a standalone application, where the whole 
index resides locally and you don't need any cluster / cloud / 
distributed feature.

I think the usage of EmbeddedSolrServer is discouraged in a 
(distributed) service scenario, because it is a direct connection to a 
SolrCore instance...but this is not a problem in the situation you 
described (as far as I know)

Best,
Andrea

On 01/15/2015 03:10 PM, Robert Krüger wrote:
> Hi,
>
> I have been using an embedded instance of solr in my desktop application
> for a long time and it works fine. At the time when I made that decision
> (vs. firing up a solr web application within my swing application) I got
> the impression embedded use is somewhat unsupported and I should expect
> problems.
>
> My first question is, is this still the case now (4 years later), that
> embedded solr is discouraged?
>
> The one limitation I am running into is that I cannot use the solr admin UI
> for debugging purposes (mainly for running queries). Is there any other way
> to do this other than no longer using embedded solr and programmatically
> firing up a web application (e.g. using jetty)? Should I do the latter
> anyway?
>
> Any insights/advice greatly appreciated.
>
> Best regards,
>
> Robert
>