Skip to content

Commit 3b2f2ea

Browse files
author
Brett Hazen
committed
Make PBC the default protocol
1 parent dad1054 commit 3b2f2ea

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: python_test.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def LoadTweets(protocol, bucket, quantity, term):
6666
results = api.GetSearch(term, count=perpage, max_id=earliest_id)
6767

6868
# Make sure search is enabled before storing results
69-
# if protocol != "pbc":
70-
# bucket.enable_search()
69+
bucket.enable_search()
7170
bucket.allow_mult = True
7271
for status in results:
7372
if status.id < earliest_id:
@@ -98,7 +97,7 @@ def SearchTweets(client, bucket, term):
9897
# First parameter is the bucket we want to search within, the second
9998
# is the query we want to perform.
10099
print 'tweet:{0}'.format(term)
101-
search_query = client.solr.search(bucket.name, 'tweet:{0}'.format(term))
100+
search_query = client.fulltext_search(bucket.name, 'tweet:{0}'.format(term))
102101
if search_query != None:
103102
num_found = search_query['num_found']
104103
if num_found > 0:
@@ -149,10 +148,10 @@ def MapReduceTweets(client, bucket, term):
149148
# Connect to Riak.
150149
options={}
151150
options['timeout'] = 10
152-
if args.protocol == 'pbc':
153-
client = riak.RiakClient(host=args.host, protocol=args.protocol, pb_port=args.pbc, transport_options = options)
154-
else:
151+
if args.protocol != 'pbc':
155152
client = riak.RiakClient(host=args.host, protocol=args.protocol, http_port=args.http, transport_options = options)
153+
else:
154+
client = riak.RiakClient(host=args.host, protocol=args.protocol, pb_port=args.pbc, transport_options = options)
156155

157156
# Choose the bucket to store data in.
158157
bucket = client.bucket('twitter')

0 commit comments

Comments
 (0)