Python utilities for solr?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Python utilities for solr?

Jack L
Doing queries is so easy with Python, thanks to solr's
Python format support. Is there any Python utility classes for
posting documents? Which I think, is essentially a Python
class to generate XML documents (before JSON support is available)
from Python objects. Then again, JSON for posting would be
really nice to have :)

--
Best regards,
Jack

Reply | Threaded
Open this post in threaded view
|

Re: Python utilities for solr?

Erik Hatcher
There is a solr.py in the Solr clients directory:

        http://svn.apache.org/repos/asf/lucene/solr/trunk/client/python/solr.py

It's got some utility methods for generating <field>'s.

        Erik


On Apr 15, 2007, at 6:47 PM, Jack L wrote:

> Doing queries is so easy with Python, thanks to solr's
> Python format support. Is there any Python utility classes for
> posting documents? Which I think, is essentially a Python
> class to generate XML documents (before JSON support is available)
> from Python objects. Then again, JSON for posting would be
> really nice to have :)
>
> --
> Best regards,
> Jack

Reply | Threaded
Open this post in threaded view
|

Re: Python utilities for solr?

Mike Klaas
In reply to this post by Jack L
On 4/15/07, Jack L <[hidden email]> wrote:
> Doing queries is so easy with Python, thanks to solr's
> Python format support. Is there any Python utility classes for
> posting documents? Which I think, is essentially a Python
> class to generate XML documents (before JSON support is available)
> from Python objects. Then again, JSON for posting would be
> really nice to have :)

It is not documented very well, but you can pass in a multi-map to the
solr.py client:

.add(field_one=['one', 'two', 'three'], field_two='value', ...)

-Mike
Reply | Threaded
Open this post in threaded view
|

Re: Python utilities for solr?

rubdabadub
There is also this .. I discovered it when i was trying to find some
djngo - solr working example..

http://code.google.com/p/fac-back-opac/

Cheers

On 4/16/07, Mike Klaas <[hidden email]> wrote:

> On 4/15/07, Jack L <[hidden email]> wrote:
> > Doing queries is so easy with Python, thanks to solr's
> > Python format support. Is there any Python utility classes for
> > posting documents? Which I think, is essentially a Python
> > class to generate XML documents (before JSON support is available)
> > from Python objects. Then again, JSON for posting would be
> > really nice to have :)
>
> It is not documented very well, but you can pass in a multi-map to the
> solr.py client:
>
> .add(field_one=['one', 'two', 'three'], field_two='value', ...)
>
> -Mike
>
Reply | Threaded
Open this post in threaded view
|

Re[2]: Python utilities for solr?

Jack L
In reply to this post by Mike Klaas
Mike and Erik, thanks for the reply. Excellent. I'll try it out.

> On 4/15/07, Jack L <[hidden email]> wrote:
>> Doing queries is so easy with Python, thanks to solr's
>> Python format support. Is there any Python utility classes for
>> posting documents? Which I think, is essentially a Python
>> class to generate XML documents (before JSON support is available)
>> from Python objects. Then again, JSON for posting would be
>> really nice to have :)

> It is not documented very well, but you can pass in a multi-map to the
> solr.py client:

> .add(field_one=['one', 'two', 'three'], field_two='value', ...)

> -Mike

Reply | Threaded
Open this post in threaded view
|

solr.py - set boosts?

Jack L
In reply to this post by Mike Klaas
I've been using solr.py to post and search. It works well.
Is it possible to specify doc boost and field boost with it?

Jack

Erik> There is a solr.py in the Solr clients directory:
Erik> http://svn.apache.org/repos/asf/lucene/solr/trunk/client/python/solr.py
Erik> It's got some utility methods for generating <field>'s.

Mike> It is not documented very well, but you can pass in a multi-map to the
Mike> solr.py client:

Mike> .add(field_one=['one', 'two', 'three'], field_two='value', ...)


Reply | Threaded
Open this post in threaded view
|

Re: solr.py - set boosts?

Mike Klaas
On 5/3/07, Jack L <[hidden email]> wrote:
> I've been using solr.py to post and search. It works well.
> Is it possible to specify doc boost and field boost with it?

Not currently, but there is an improved client in the works which you
can try here:

http://issues.apache.org/jira/browse/SOLR-216

-Mike