[packagekit] extremely quick search for available package names matching a pattern

Lukas Vacek lucas.vacek at gmail.com
Mon Apr 15 02:27:04 PDT 2013


Thanks for your answer.

I expected that to be the case. Interestingly, I still get faster
results using "yum search" than "pkcon search name" on Fedora, for
example.

I was hoping there is a functionality I am missing which could match
apt-cache pkgnames. Anyway, it's useful to me to know there isn't
search functionality which would guarantee that speed and I should
design my code with that in mind.

Thanks,
Lukas

On Mon, Apr 15, 2013 at 8:33 AM, Sebastian Heinlein <sebi at glatzor.de> wrote:
> Am 2013-04-14 03:14, schrieb Lukas Vacek:
>>
>> Hello there,
>>
>> I am developing a Gnome Shell extension which shows available
>> software to install. The user can type, for example, "opent" and then
>> just click "openttd" to install the package. It's pretty decent. :-)
>> https://extensions.gnome.org/extension/95/appsearch/ [1]
>>
>>
>> This works all fine on Debian/Ubuntu using "apt-cache pkgnames [
>> prefix ]". I am doing my best to support PackageKit as well but
>> getting the results fast enough is a bit problematic.
>>
>> At the moment I use "pkcon -p resolve <search_term>" which is very
>> quick and works fine, however, this works only for exact matches.
>>
>> I have experimented with "pkcon -p search name <search_term>" and
>> indeed it works fine but it's just too slow for this use case :-( ...
>> it can take up to several  (sometimes more than 5) seconds to get
>> results.
>>
>> Is there a faster way to get all available packages with names
>> matching a pattern? (No need for regex or so, actually, just prefix
>> match will do)
>
>
> The speed of the query depends on the backend implementation. You will see
> different results for the differnet backends. So you should design your
> extension having in mind that the search could take some seconds.
>
> The PackageKit compatibilty layer of aptdaemon which is shipped in Ubuntu by
> default makes optionally use of the Xapian Apt Index. So you even get a
> stemmer if you search for details. Perhaps this could also be an idea for
> the APTcc backend, too.
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit


More information about the PackageKit mailing list