[ 
https://issues.apache.org/jira/browse/SOLR-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rob Young updated SOLR-577:
---------------------------

    Attachment: solr.py

Fixed a couple of bugs and added support for multi-valued fields.


conn = solr.SolrConnection()
# simple interface still works
conn.add(uid='test:001', description="my test description")
# boosted fields
conn.add(uid='test:002', description=solr.Field("a boosted description", 
boost=1.5))
# multi-valued fields
conn.add(uid='test:003', multival=[solr.Field('value one', boost=1.3), 'another 
value'])
doc = solr.Document(boost=1.5)
doc.add(uid='test:005', description="a value")
conn.add(doc)

> added support for boosting fields and documents to python solr interface
> ------------------------------------------------------------------------
>
>                 Key: SOLR-577
>                 URL: https://issues.apache.org/jira/browse/SOLR-577
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - python
>         Environment: linux, python
>            Reporter: Rob Young
>         Attachments: solr.py
>
>
> Added the ability to set boosts on fields and documents when indexing. This 
> is done through two new classes solr.Document and solr.Field
> c = solr.SolrConnection(host='localhost:8081')
> c.add(id='123', name=solr.Field('this is a field', boost=1.5))
> doc = solr.Document(boost=1.5)
> doc.add(solr.Field(name='title', value="a value for my field", boost=1.1))
> c.addDoc(doc)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to