mfares / solrpy

Automatically exported from code.google.com/p/solrpy
0 stars 0 forks source link

No support for boosting fields or documents #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There is currently no support for boosting fields or documents at index
time. I have attached a patch which provides this as described below. It
also adds a ping method to check the server is up.

Usage:
c = solr.SolrConnection(host='localhost:8080')
# field boost
c.add(id=123, name=solr.Field('this is a field', boost=1.1))

# document boost
doc = solr.Document(boost=1.5)
doc.add(solr.Field(name="title", value="a value for my field", boost=1.1))
c.add(doc)

Original issue reported on code.google.com by bubble...@gmail.com on 18 Sep 2008 at 3:14

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the code! Just some minor issues here - can you make it
follow the PEP 8 style guide, no camelCase and indent by four spaces? - I think 
it's the Google's standard to use two-spaces indent but I wouldn't want to 
introduce it here. Also, you're using conditional expressions new in Python 2.5
(value = 'true' if value else 'false') which means breaking the current solrpy
promise to work correctly with Python 2.3+. Other than that, the code looks
fine, although it would certainly be better if you could also create the test 
cases
as someone will need to do it anyway..

Original comment by ds...@gefira.pl on 18 Sep 2008 at 5:28

GoogleCodeExporter commented 8 years ago
Sure thing, I'll get the changes done as soon as I can.

Original comment by bubble...@gmail.com on 19 Sep 2008 at 9:22

GoogleCodeExporter commented 8 years ago
OK, I've been away from this project for quite a while but I'm back on the 
case. Your
suggestions have been implemented and unit tests have been modified / added. The
attached patch is against r28

Original comment by bubble...@gmail.com on 12 Feb 2009 at 1:01

Attachments:

GoogleCodeExporter commented 8 years ago
Unfortunately this patch doesn't apply to trunk anymore. Is there any chance 
you'd be 
willing to resubmit. Sorry for the delay :-(

Original comment by ed.summers on 4 Feb 2010 at 11:53