Skip to content

Commit

Permalink
Merge pull request aparo#162 from sirex/master
Browse files Browse the repository at this point in the history
Added HTTPAuth parameters CouchDBRiver.
  • Loading branch information
Alberto Paro committed Feb 20, 2012
2 parents 57a9b5b + 932468b commit 10f1ee3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyes/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def __init__(self,
self.index_boost = index_boost
self.min_score = min_score
self.stats = stats
self.bulk_read = None

def get_facet_factory(self):
"""
Expand Down
10 changes: 9 additions & 1 deletion pyes/rivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,18 @@ def serialize(self):
class CouchDBRiver(River):
type = "couchdb"

def __init__(self, host="localhost", port=5984, db="mydb", filter=None, filter_params=None, script=None, **kwargs):
def __init__(self, host="localhost", port=5984, db="mydb", filter=None,
filter_params=None, script=None, user=None, password=None,
**kwargs):
super(CouchDBRiver, self).__init__(**kwargs)
self.host = host
self.port = port
self.db = db
self.filter = filter
self.filter_params = filter_params
self.script = script
self.user = user
self.password = password

def serialize(self):
result = {
Expand All @@ -125,4 +129,8 @@ def serialize(self):
result[self.type]["filter_params"] = self.filter_params
if self.script is not None:
result[self.type]["script"] = self.script
if self.user is not None:
result[self.type]["user"] = self.user
if self.password is not None:
result[self.type]["password"] = self.password
return result

0 comments on commit 10f1ee3

Please sign in to comment.