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 Raimon Bosch <ra...@gmail.com> on 2011/09/16 23:17:20 UTC

soft commits in EmbeddedSolrServer

Hi all,

I'm checking how to do soft commits with the new version of Solr. I'm using
EmbeddedSolrServer to add documents to my index. How can I perform a soft
commit using this class? Is it possible? Or should I use the trunk?

http://wiki.apache.org/solr/NearRealtimeSearch
http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html

Thanks in advance,
Raimon Bosch.

Re: soft commits in EmbeddedSolrServer

Posted by Raimon Bosch <ra...@gmail.com>.
Yes,

This worked for me:

//Solr Server initialization
System.setProperty("solr.solr.home", solrHome);
CoreContainer.Initializer initializer = new CoreContainer.Initializer();
coreContainer = initializer.initialize();
server = new EmbeddedSolrServer(coreContainer, "your_corename");

//Create your SolrInputDocument doc
...

//Soft commit
UpdateRequest req = new UpdateRequest();
req.setAction(ACTION.COMMIT, false, false, true);
req.add( doc );
UpdateResponse rsp = req.process( server );

Regards,
Raimon Bosch.

2012/6/26 Mark Miller <ma...@gmail.com>

> Yes - just pass the param same as you would if not using embedded
>
> On Jun 25, 2012, at 4:40 PM, Raimon Bosch wrote:
>
> > Old question but I'm still wondering if this is possible. I'm using Solr
> > 4.0.
> >
> > Can I use the EmbeddedSolrServer to perform soft commits?
> >
> > 2011/9/16 Raimon Bosch <ra...@gmail.com>
> >
> >> Hi all,
> >>
> >> I'm checking how to do soft commits with the new version of Solr. I'm
> >> using EmbeddedSolrServer to add documents to my index. How can I
> perform a
> >> soft commit using this class? Is it possible? Or should I use the trunk?
> >>
> >> http://wiki.apache.org/solr/NearRealtimeSearch
> >>
> >>
> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html
> >>
> >> Thanks in advance,
> >> Raimon Bosch.
> >>
>
> - Mark Miller
> lucidimagination.com
>
>
>
>
>
>
>
>
>
>
>
>

Re: soft commits in EmbeddedSolrServer

Posted by Mark Miller <ma...@gmail.com>.
Yes - just pass the param same as you would if not using embedded

On Jun 25, 2012, at 4:40 PM, Raimon Bosch wrote:

> Old question but I'm still wondering if this is possible. I'm using Solr
> 4.0.
> 
> Can I use the EmbeddedSolrServer to perform soft commits?
> 
> 2011/9/16 Raimon Bosch <ra...@gmail.com>
> 
>> Hi all,
>> 
>> I'm checking how to do soft commits with the new version of Solr. I'm
>> using EmbeddedSolrServer to add documents to my index. How can I perform a
>> soft commit using this class? Is it possible? Or should I use the trunk?
>> 
>> http://wiki.apache.org/solr/NearRealtimeSearch
>> 
>> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html
>> 
>> Thanks in advance,
>> Raimon Bosch.
>> 

- Mark Miller
lucidimagination.com












Re: soft commits in EmbeddedSolrServer

Posted by Raimon Bosch <ra...@gmail.com>.
Old question but I'm still wondering if this is possible. I'm using Solr
4.0.

Can I use the EmbeddedSolrServer to perform soft commits?

2011/9/16 Raimon Bosch <ra...@gmail.com>

> Hi all,
>
> I'm checking how to do soft commits with the new version of Solr. I'm
> using EmbeddedSolrServer to add documents to my index. How can I perform a
> soft commit using this class? Is it possible? Or should I use the trunk?
>
> http://wiki.apache.org/solr/NearRealtimeSearch
>
> http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html
>
> Thanks in advance,
> Raimon Bosch.
>