Hi Abhishek, The Riak Python client does not yet have official support for the version of Riak Search in Riak 2.0.0pre11. That said, you should be able to add values to a Riak 2.0 cluster (with search configured and enabled) and then query those values using a Python Solr client.
In addition, to enable search in Riak 2.0.0pre11, you need to edit the `riak.conf` configuration file. Inside `riak.conf` look for `search = off` and switch that to `search = on`. After that, please see the Riak Search simple setup section in our online documentation for further details on indexing and querying data. [0] -- Hector [0] http://docs.basho.com/riak/2.0.0pre11/dev/using/search/#Simple-Setup On Sun, Feb 16, 2014 at 10:41 AM, Abhishek kumar <[email protected]> wrote: > I am a newbie in RIAK and trying this example but getting error: > http://basho.github.io/riak-python-client/query.html#fulltext-search > > Riak version: 2.0.0pre11 > client-lib: python > > client = riak.RiakClient(nodes=[{'host':'127.0.0.1','http_port':8098}], > RETRY_COUNT=2, protocol='http') > log.info('Connection to server: %s',client.ping()) > > test_bucket = client.bucket('test') > test_bucket.enable_search() > test_bucket.new("one", data={'value':'one'}, > content_type="application/json").store() > > test_bucket.search('value=one') > > On making the search command, getting following error: > > Traceback (most recent call last): > File "start.py", line 27, in <module> > test_bucket.search('value=one') > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/bucket.py", > line 448, in search > return self._client.fulltext_search(self.name, query, **params) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/client/transport.py", > line 184, in wrapper > return self._with_retries(pool, thunk) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/client/transport.py", > line 126, in _with_retries > return fn(transport) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/client/transport.py", > line 182, in thunk > return fn(self, transport, *args, **kwargs) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/client/operations.py", > line 509, in fulltext_search > return transport.search(index, query, **params) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/transports/http/transport.py", > line 379, in search > url = self.solr_select_path(index, query, **options) > File > "/usr/local/lib/python2.7/dist-packages/riak-2.0.2.post50-py2.7.egg/riak/transports/http/resources.py", > line 108, in solr_select_path > if not self.riak_solr_searcher_wm or self.yz_wm_search: > AttributeError: 'RiakHttpTransport' object has no attribute 'yz_wm_search' > --------------------------- > app.config, looks like following: > > %% Riak Search Config > {riak_search, [ > %% To enable Search functionality set this 'true'. > {enabled, true} > ]}, > > Someone please help, and let me know where I am wrong. > > -- > Abhishek > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
