You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by kumar swami <uk...@gmail.com> on 2011/11/30 13:42:19 UTC

how to access solr from pig

Hi friends,

I am new to Pig library. I need help on how to read data from solr using
pig?. If you have any code samples please provide me.

Thanks, swami

Re: how to access solr from pig

Posted by John Conwell <jo...@iamjohn.me>.
I havent seen anyone use solr as an input format.  I think you'll have
issues with controlling parallel reads across different splits in the data.
 You could write an custom hadoop input format that first queries solr for
a document count, and then queries solr for the actual documents, and for
each split specifies what document number to start on, and how many
documents to return.

Depending on your need for performance, automation, and such, I think your
best bet would be to just write a custom tool that reads all the documents
you want from solr, and outputs them in a text document that can be easily
read by pig.


On Wed, Nov 30, 2011 at 4:42 AM, kumar swami <uk...@gmail.com> wrote:

> Hi friends,
>
> I am new to Pig library. I need help on how to read data from solr using
> pig?. If you have any code samples please provide me.
>
> Thanks, swami
>



-- 

Thanks,
John C

Re: how to access solr from pig

Posted by Andrew Clegg <an...@gmail.com>.
If the index contains term vectors, using mahout to extract them may
be quicker than going in via the query interface:

http://www.lucidimagination.com/blog/2010/03/16/integrating-apache-mahout-with-apache-lucene-and-solr-part-i-of-3/

But as John suggests, that's still a pre-processing step rather than a
way to hook pig in directly.

On 30 November 2011 12:42, kumar swami <uk...@gmail.com> wrote:
> Hi friends,
>
> I am new to Pig library. I need help on how to read data from solr using
> pig?. If you have any code samples please provide me.
>
> Thanks, swami



-- 

http://tinyurl.com/andrew-clegg-linkedin | http://twitter.com/andrew_clegg