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 ra...@thomsonreuters.com on 2012/03/19 16:48:23 UTC

is the SolrJ call to add collection of documents a blocking function call ?

Hi:
   I am trying to index a collection of SolrInputDocs to a Solr server. I was wondering if the call I make to add the documents (the add(Collection<SolrInputDocument>)  call ) is a blocking function call ?

I would also like to know if the add call is a call that would take longer for a larger collection of documents


Thanks

Ramdev

Re: is the SolrJ call to add collection of documents a blocking function call ?

Posted by darul <da...@gmail.com>.
Hmm nice feature Erik

--
View this message in context: http://lucene.472066.n3.nabble.com/is-the-SolrJ-call-to-add-collection-of-documents-a-blocking-function-call-tp3839387p3842232.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: is the SolrJ call to add collection of documents a blocking function call ?

Posted by Erick Erickson <er...@gmail.com>.
Also consider StreamingUpdateSolrServer if you want multiple threads
to operate from your client.

Best
Erick

On Tue, Mar 20, 2012 at 4:12 AM, Michael Kuhlmann <ku...@solarier.de> wrote:
> Hi Ramdev,
>
> add() is a blocking call. Otherwise it had to start an own background thread
> which is not what a library like Solrj should do (how many threads at most?
> At which priority? Which thread group? How long keep them pooled?)
>
> And, additionally, you might want to know whether the transmission was
> successful, or whether your guinea pig has eaten the network cable just in
> the middle of the transmission.
>
> But it's easy to write your own background task that adds your documents to
> the Solr server. Using Java's ExecutionService class, this is done within
> two minutes.
>
> Greetings,
> Kuli
>
> Am 19.03.2012 16:48, schrieb ramdev.wudali@thomsonreuters.com:
>
>> Hi:
>>    I am trying to index a collection of SolrInputDocs to a Solr server. I
>> was wondering if the call I make to add the documents (the
>> add(Collection<SolrInputDocument>)  call ) is a blocking function call ?
>>
>> I would also like to know if the add call is a call that would take longer
>> for a larger collection of documents
>>
>>
>> Thanks
>>
>> Ramdev
>>
>

Re: is the SolrJ call to add collection of documents a blocking function call ?

Posted by Michael Kuhlmann <ku...@solarier.de>.
Hi Ramdev,

add() is a blocking call. Otherwise it had to start an own background 
thread which is not what a library like Solrj should do (how many 
threads at most? At which priority? Which thread group? How long keep 
them pooled?)

And, additionally, you might want to know whether the transmission was 
successful, or whether your guinea pig has eaten the network cable just 
in the middle of the transmission.

But it's easy to write your own background task that adds your documents 
to the Solr server. Using Java's ExecutionService class, this is done 
within two minutes.

Greetings,
Kuli

Am 19.03.2012 16:48, schrieb ramdev.wudali@thomsonreuters.com:
> Hi:
>     I am trying to index a collection of SolrInputDocs to a Solr server. I was wondering if the call I make to add the documents (the add(Collection<SolrInputDocument>)  call ) is a blocking function call ?
>
> I would also like to know if the add call is a call that would take longer for a larger collection of documents
>
>
> Thanks
>
> Ramdev
>