@@ -66,8 +66,7 @@ def LoadTweets(protocol, bucket, quantity, term):
66
66
results = api .GetSearch (term , count = perpage , max_id = earliest_id )
67
67
68
68
# Make sure search is enabled before storing results
69
- # if protocol != "pbc":
70
- # bucket.enable_search()
69
+ bucket .enable_search ()
71
70
bucket .allow_mult = True
72
71
for status in results :
73
72
if status .id < earliest_id :
@@ -98,7 +97,7 @@ def SearchTweets(client, bucket, term):
98
97
# First parameter is the bucket we want to search within, the second
99
98
# is the query we want to perform.
100
99
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 ))
102
101
if search_query != None :
103
102
num_found = search_query ['num_found' ]
104
103
if num_found > 0 :
@@ -149,10 +148,10 @@ def MapReduceTweets(client, bucket, term):
149
148
# Connect to Riak.
150
149
options = {}
151
150
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' :
155
152
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 )
156
155
157
156
# Choose the bucket to store data in.
158
157
bucket = client .bucket ('twitter' )
0 commit comments