Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: ruby-dev

solr ruby code update

 

 

Lucene ruby-dev RSS feed   Index | Next | Previous | View Threaded


goodieboy at gmail

Dec 16, 2008, 8:52 PM

Post #1 of 7 (6611 views)
Permalink
solr ruby code update

I've been re-writing/factoring the solr ruby gem -- and the source code can
be found here:

http://github.com/mwmitchell/solr/tree/master

The current version is 0.5.1 and can be installed by running:

gem sources -a http://gems.github.com
sudo gem install mwmitchell-solr

More docs coming, but for the nitty gritty, have a look at some of the tests
if needed.

If you use solr-ruby at all, please have a look. I would love to hear from
some of the ruby folks out there!

Cheers,

Matt


erik at ehatchersolutions

Dec 16, 2008, 9:09 PM

Post #2 of 7 (6355 views)
Permalink
Re: solr ruby code update [In reply to]

wow, at first glance this looks spectacular, Matt! one of these
dreamy days i'll carve out time to really play... maybe sooner if you
keep dazzling us like this.


On Dec 16, 2008, at 11:52 PM, Matt Mitchell wrote:

> I've been re-writing/factoring the solr ruby gem -- and the source
> code can
> be found here:
>
> http://github.com/mwmitchell/solr/tree/master
>
> The current version is 0.5.1 and can be installed by running:
>
> gem sources -a http://gems.github.com
> sudo gem install mwmitchell-solr
>
> More docs coming, but for the nitty gritty, have a look at some of
> the tests
> if needed.
>
> If you use solr-ruby at all, please have a look. I would love to
> hear from
> some of the ruby folks out there!
>
> Cheers,
>
> Matt


erik at ehatchersolutions

Dec 16, 2008, 9:12 PM

Post #3 of 7 (6366 views)
Permalink
Re: solr ruby code update [In reply to]

tell us more about the willpaginate stuff. your example:

<%= will_paginate(@response) %>

does this paginate a live cursor through solr by requesting start/row
windows? or is it paginating through the docs returned to the
client? shouldn't you paginate an @query or an @request than the
response?

Erik


On Dec 16, 2008, at 11:52 PM, Matt Mitchell wrote:

> I've been re-writing/factoring the solr ruby gem -- and the source
> code can
> be found here:
>
> http://github.com/mwmitchell/solr/tree/master
>
> The current version is 0.5.1 and can be installed by running:
>
> gem sources -a http://gems.github.com
> sudo gem install mwmitchell-solr
>
> More docs coming, but for the nitty gritty, have a look at some of
> the tests
> if needed.
>
> If you use solr-ruby at all, please have a look. I would love to
> hear from
> some of the ruby folks out there!
>
> Cheers,
>
> Matt


erik at ehatchersolutions

Dec 16, 2008, 9:25 PM

Post #4 of 7 (6357 views)
Permalink
Re: solr ruby code update [In reply to]

one concept i think we can remove from next gen solr-ruby's....
autocommit. the solr side can handle that configuration, and it's
often not really even a good idea to commit until your job is done, as
we now have rollback features and solr really should be able to handle
lots of uncommitted docs.

thoughts? maybe i'm wrong and having a client api sending commits
periodically in a big batch is warranted.

Erik


On Dec 16, 2008, at 11:52 PM, Matt Mitchell wrote:

> I've been re-writing/factoring the solr ruby gem -- and the source
> code can
> be found here:
>
> http://github.com/mwmitchell/solr/tree/master
>
> The current version is 0.5.1 and can be installed by running:
>
> gem sources -a http://gems.github.com
> sudo gem install mwmitchell-solr
>
> More docs coming, but for the nitty gritty, have a look at some of
> the tests
> if needed.
>
> If you use solr-ruby at all, please have a look. I would love to
> hear from
> some of the ruby folks out there!
>
> Cheers,
>
> Matt


goodieboy at gmail

Dec 17, 2008, 5:39 AM

Post #5 of 7 (6335 views)
Permalink
Re: solr ruby code update [In reply to]

Erik,

I'm glad you like it so far, definitely some things to work out still but
I'm feeling pretty happy with it.

The pagination is real, not just a huge doc set using array cursors. The
library is converting :page and :per_page to "rows" and "start. You use it
by first querying, using the :page and :per_page params like:

result = solr.query(:page=>1, :per_page=>10, :q=>'*:*')
# or "search"
result = solr.search('ipod', :page=>1, :per_page=>10)

The result object now has methods that WillPaginate can hook into, namely:
current_page, total_pages, next_page and previous_page. With those methods,
the will_paginate view helper can create the pagination view widget. Of
course, the :page param would probably be dynamic; in Rails/Merb --
params[:page].

But you bring up a good point about where the pagination should be
"happening". Maybe instead of paginating the top-level "result", it'd be
more intuitive to do it on just a document set like:

result = solr.query(:page=>1, :per_page=>10, :q=>'*:*')
@docs = result.documents

<%= will_paginate(@docs) %>

What do you think?

Thanks for having a look and please do play with it when you get a chance!

Matt

On Wed, Dec 17, 2008 at 12:12 AM, Erik Hatcher
<erik [at] ehatchersolutions>wrote:

> tell us more about the willpaginate stuff. your example:
>
> <%= will_paginate(@response) %>
>
> does this paginate a live cursor through solr by requesting start/row
> windows? or is it paginating through the docs returned to the client?
> shouldn't you paginate an @query or an @request than the response?
>
> Erik
>
>
> On Dec 16, 2008, at 11:52 PM, Matt Mitchell wrote:
>
> I've been re-writing/factoring the solr ruby gem -- and the source code
>> can
>> be found here:
>>
>> http://github.com/mwmitchell/solr/tree/master
>>
>> The current version is 0.5.1 and can be installed by running:
>>
>> gem sources -a http://gems.github.com
>> sudo gem install mwmitchell-solr
>>
>> More docs coming, but for the nitty gritty, have a look at some of the
>> tests
>> if needed.
>>
>> If you use solr-ruby at all, please have a look. I would love to hear from
>> some of the ruby folks out there!
>>
>> Cheers,
>>
>> Matt
>>
>
>


erik at ehatchersolutions

Dec 17, 2008, 7:29 AM

Post #6 of 7 (6355 views)
Permalink
Re: solr ruby code update [In reply to]

On Dec 17, 2008, at 8:39 AM, Matt Mitchell wrote:
> The result object now has methods that WillPaginate can hook into,
> namely:
> current_page, total_pages, next_page and previous_page. With those
> methods,
> the will_paginate view helper can create the pagination view widget.

Gotcha, so WillPaginate makes it nicer to generate paging controls,
but isn't itself cursoring through Solr. it provides parameters that
are used elsewhere in another action. Got it (I think).

I was thinking WillPaginate was maybe doing something like
Solr::Importer::SolrSource - but I was confused.

> <%= will_paginate(@docs) %>

Nah, I think @response is better now that I think about it. You'll
want the current start/rows back from Solr in the response. @docs
won't give you that, right?

Erik


goodieboy at gmail

Dec 29, 2008, 11:22 AM

Post #7 of 7 (6243 views)
Permalink
Re: solr ruby code update [In reply to]

There have been lots of updates on this. More tests and features! And yes,
:auto_commit is gone :)

github url:

http://github.com/mwmitchell/solr/tree/master

Matt

Lucene ruby-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.