[opensuse-project] Regarding Bugzilla's XMLRPC webservice.
Hello, I'm practicing searching on the Novell Bugzilla for my GSoC project and I've stumbled upon a.. problem, I would say. According to the official documentation[0], I can pass the key 'limit' with an int value to limit the returned search results. I've tried doing this but the results I've came across are at least weird (to me). [...]
a = bz.query({'summary': 'kde'}) len(a) 3635 a = bz.query({'summary': 'kde', 'limit': 5}) a [
https://bugzilla.novell.com/xmlrpc.cgi at 0xe011d0>] a = bz.query({'summary': 'kde', 'limit': 100}) a [ https://bugzilla.novell.com/xmlrpc.cgi at 0xb4c050>, https://bugzilla.novell.com/xmlrpc.cgi at 0xb4c410>] a = bz.query({'summary': 'kde', 'limit': 10, 'offset': 10}) a [] a = bz.query({'summary': 'kde', 'limit': 100, 'offset': 10}) a []
I am using the python-bugzilla module[1], as my mentor has suggested. You can find some sample code for the usage here[2]. Basically, my question is: how can I limit the number of returned search results? Thanks! Mihnea DB [0] http://www.bugzilla.org/docs/3.4/en/html/api/Bugzilla/WebService/Bug.html -- Search section (or just ctrl+f for limit) [1] http://gitorious.org/+opensuse-developers/opensuse/python-bugzilla -- when cloning add " -b suse " or it won't work. [2] https://github.com/mihneadb/Suse-Bug-Reporter/blob/master/interact.py -- To unsubscribe, e-mail: opensuse-project+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-project+help@opensuse.org
On Sun, Jun 19, 2011 at 04:27:13PM +0300, Mihnea Dobrescu-Balaur wrote:
Hello,
I'm practicing searching on the Novell Bugzilla for my GSoC project and I've stumbled upon a.. problem, I would say. According to the official documentation[0], I can pass the key 'limit' with an int value to limit the returned search results. I've tried doing this but the results I've came across are at least weird (to me).
[...]
a = bz.query({'summary': 'kde'}) len(a) 3635 a = bz.query({'summary': 'kde', 'limit': 5}) a [
https://bugzilla.novell.com/xmlrpc.cgi at 0xe011d0>] a = bz.query({'summary': 'kde', 'limit': 100}) a [ https://bugzilla.novell.com/xmlrpc.cgi at 0xb4c050>, https://bugzilla.novell.com/xmlrpc.cgi at 0xb4c410>] a = bz.query({'summary': 'kde', 'limit': 10, 'offset': 10}) a [] a = bz.query({'summary': 'kde', 'limit': 100, 'offset': 10}) a [] I am using the python-bugzilla module[1], as my mentor has suggested. You can find some sample code for the usage here[2].
Basically, my question is: how can I limit the number of returned search results?
Hi Mihnea, I'm not on opensuse-project, so I don't see responses, if there are any. According limit - with my SQL developer experience it smells me like Mysql LIMIT extension, which works excactly like the limit and offset clauses. Novell bugzilla runs on Oracle db, where is no LIMIT, so I thought is is not implemented in Bugzilla/Oracle connector. But my testing code snipper works well (I use util-linux instead of kde, but that does not make a difference). import bugzilla url = 'https://bugzilla.novell.com/xmlrpc.cgi' klass = bugzilla.getBugzillaClassForURL(url) print("loggin in") bz = klass(url=url) # full query q = bz.query({'summary' : 'util-linux'}) # first 10 q10 = bz.query({'summary' : 'util-linux', 'limit' : 10}) # last 8 q_8 = bz.query({'summary' : 'util-linux', 'limit' : 8, 'offset' : len(q)-8}) print("full: %d" % len(q)) print("limited: %d" % len(q10)) print("with offset: %d" % len(q_8)) gave the expected results $ python test.py loggin in full: 48 limited: 10 with offset: 8 Regards Michal Vyskocil
participants (2)
-
Michal Vyskocil
-
Mihnea Dobrescu-Balaur