On 2/16/07, Erik Hatcher <erik@ehatchersolutions.com> wrote:
> A recent e-mail from Mr. KinoSearch to java-user has a quote that I
> wanted to point out here:
>
> Begin forwarded message:
> > KS 0.20 doesn't even have Document or Field classes. :) They've
> > been eliminated, and native Perl hashes are now used to transport
> > document data.
>
> I think we could simplify (wow, even at this early stage) the solrb
> code a bit by simply representing a document as a Hash. For
> multiValued data, the values would be arrays.
That's how it works with the simple python client... I like to use
natives when possible.
Example usage from solr.py:
from solr import *
c = SolrConnection(host='localhost:8983', persistent=True)
c.add(id='500',name='python test doc')
c.delete('123')
c.commit()
print c.search(q='id:[* TO *]', wt='python', rows='10',indent='on')
The separate params to add is just syntactic sugar for a map (I
believe ruby has the same thing). Adding multiple documents is done
as an array-of-map.
> Do we really need any
> other semantics at the solrb level, or does a Hash convey it all?
boosts?
Perhaps you could still use a hash, but the value could optionally be
a boosted value... is it possible to annotate any value in Ruby, or is
a separate BoostedValue class needed?
Might want to keep in mind updateable documents for the future. Not
sure how you would want them represented, but it looks like there will
be a separate param (or parameters) telling solr how to update
different fields (append, overwrite, increment, remove, etc)
-Yonik
> A recent e-mail from Mr. KinoSearch to java-user has a quote that I
> wanted to point out here:
>
> Begin forwarded message:
> > KS 0.20 doesn't even have Document or Field classes. :) They've
> > been eliminated, and native Perl hashes are now used to transport
> > document data.
>
> I think we could simplify (wow, even at this early stage) the solrb
> code a bit by simply representing a document as a Hash. For
> multiValued data, the values would be arrays.
That's how it works with the simple python client... I like to use
natives when possible.
Example usage from solr.py:
from solr import *
c = SolrConnection(host='localhost:8983', persistent=True)
c.add(id='500',name='python test doc')
c.delete('123')
c.commit()
print c.search(q='id:[* TO *]', wt='python', rows='10',indent='on')
The separate params to add is just syntactic sugar for a map (I
believe ruby has the same thing). Adding multiple documents is done
as an array-of-map.
> Do we really need any
> other semantics at the solrb level, or does a Hash convey it all?
boosts?
Perhaps you could still use a hash, but the value could optionally be
a boosted value... is it possible to annotate any value in Ruby, or is
a separate BoostedValue class needed?
Might want to keep in mind updateable documents for the future. Not
sure how you would want them represented, but it looks like there will
be a separate param (or parameters) telling solr how to update
different fields (append, overwrite, increment, remove, etc)
-Yonik