Previous topic

2.1.7.1.7. solrclient.SOLRValuesResponseIterator

Next topic

2.1.7.1.9. solrclient.SolrException

This Page

2.1.7.1.8. solrclient.SolrConnection

class solrclient.SolrConnection(host='localhost:8080', solrBase='/solr', persistent=True, postHeaders={})

Provides a connection to the SOLR index.

__init__(host='localhost:8080', solrBase='/solr', persistent=True, postHeaders={})

Methods

__init__([host, solrBase, persistent, ...])
add(**fields)
addDocs(docs) docs is a list of fields that are a dictionary of name:value for a record
addMany(arrOfMap)
close()
coerceType(ftype, value) Returns unicode(value) after trying to coerce it into the SOLR field type.
commit([waitFlush, waitSearcher, optimize])
count([q, fq]) Return the number of entries that match query
delete(id)
deleteByQuery(query)
doPost(url, body, headers)
doUpdateXML(request)
escapeKey(key)
escapeQueryTerm(term)
    • && || ! ( ) { } [ ] ^ ” ~ * ? :
escapeVal(val)
fieldAlphaHistogram(name[, q, fq, nbins, ...]) Generates a histogram of values from a string field.
fieldHistogram(name[, q, fq, nbins, minmax, ...]) Generates a histogram of values.
fieldHistogram2d(colname, rowname[, q, fq, ...]) Generates a 2d histogram of values.
fieldMinMax(name[, q, fq]) Returns the minimum and maximum values of the specified field.
fieldValues(name[, q, fq, maxvalues, sort]) Retrieve the unique values for a field, along with their usage counts.
get(id) Retrieves the specified document.
getFields([numTerms]) Retrieve a list of fields.
getIds([query, fq, start, rows]) Returns a dictionary of:
getSolrType(field) Returns the SOLR type of the specified field name. Assumes the convention
getftype(name) Returns the python type for the specified field name.
prepareQueryTerm(field, term) Prepare a query term for inclusion in a query.
search(params)