

def test_search_integration(self):
    bucket = self.client.bucket(testrun_search_bucket)
    bucket.new('one', {
        'foo': 'one',
        'bar': 'red',
    }).store()
    bucket.new('two', {
        'foo': 'two',
        'bar': 'green',
    }).store()
    bucket.new('three', {
        'foo': 'three',
        'bar': 'blue',
    }).store()
    bucket.new('four', {
        'foo': 'four',
        'bar': 'orange',
    }).store()
    self.new('five', {
        'foo': 'five',
        'bar': 'yellow',
    }).store()
    results = self.client.fulltext_search(testrun_search_bucket, 'foo:one OR foo:two')
    if (len(results) == 0):
        print('\n\nNot running test "testSearchIntegration()".\n')
        print('Please ensure that you have installed the Riak\n            Search hook on bucket "searchbucket" by running\n            "bin/search-cmd install searchbucket".\n\n')
        return
    self.assertEqual(len(results['docs']), 2)
    query = '(foo:one OR foo:two OR foo:three OR foo:four) AND                 (NOT bar:green)'
    results = self.client.fulltext_search(testrun_search_bucket, query)
    self.assertEqual(len(results['docs']), 3)

dataset/ETHPy150Open basho/riak-python-client/riak/tests/test_search.py SearchTests.test_search_integration/VarMisuse@121/168 `bucket`->`self`