You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Mike Klaas <mi...@gmail.com> on 2007/06/01 20:49:28 UTC
Re: Commented: (SOLR-216) Improvements to solr.py
On 30-May-07, at 12:43 PM, Erik Hatcher wrote:
>
> On May 29, 2007, at 4:38 PM, Mike Klaas wrote:
>>> I agree. I was not aware of field boosts at the time. I'll code
>>> this change.
>>
>> Unfortunately, it is still somewhat awkward. In my python client
>> I end up passing (<name>, <value>, <field boost or None>)
>> everywhere, but that clutters up the api considerably.
>>
>> It might be worth taking a look at the ruby client to see what
>> Eric's done for the api.
>
> In the ruby client, we have the ability to use a Ruby Hash as a
> document when no boosts are needed:
>
> doc = {:field => "value"}
>
> But also use the Field object when boosts are desired:
>
> doc = Solr::Document.new
> doc << Solr::Field.new(:field => "value", :boost => 3.0)
>
> The boost stuff was contributed by Coda Hale (credit where it's
> due :) - I had punted on that initially.
I think I prefer the approach that I suggested for the python
client. The ruby approach makes sense if you want to define a proper
Document class with Fields and such. 99% of the time a map is
sufficient, and tuple fieldname keys allow maps to be slightly
extended to support boost functionality.
-Mike