[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#709411: Debian Code Search: PTS integration



Hi Paul,

Paul Wise <pabs@debian.org> writes:
> Unfortunately I realised that this isn't easy because there is only one
> query parameter for the search URL and I think having package:foo in the
> search box on the PTS would use too much space. Michael, would it be
> possible for us to have a hidden field containing the package name that
> would be passed as a separate parameter but get merged into the query on
> the DCS site? Something like this should result in "package:foo bar"
> being the search query and being present in the DCS search box.
I thought about this a little bit and the preferred way to implement
this is to have a redirect which would then just prepend (or append,
doesn’t matter) package:foo to the search term. That way, there is only
one interface to DCS to document/take care of.

Furthermore, it would be good to make this redirect automatic using a
tiny bit of JavaScript, i.e. having something like:
<form>
<input type="hidden" name="package" value="foo">
<input type="text" name="q" placeholder="search term">
<input type="submit">
</form>

…and having a bit of JavaScript code which would delete the package
field before submitting and adding package:foo to the q input field.

This saves a redirect which is moderately costly on good internet
connections but hugely painful on mobile connections. Also, it decreases
load on the server which performs the actual redirect.

As for which server to use, I’d vote for the PTS code handling the
redirect, since the PTS is the one who needs the feature :). If for some
reason this is super-complicated within the PTS, I am not dead set on
this, but I would like to hear a decent reason if I should implement
that code within DCS.

> Michael, which PTS pages should the search box be on? Are all source
> packages in Debian indexed? All source packages in unstable? How long
> does it usually take to index a new or updated source package?
See http://codesearch.debian.net/faq — all sid source packages are
indexed. Due to quite a bit of CPU time required for this, the index is
only updated once a week, typically on friday. This currently is a
manual process, but I intend to automate it real soon.

-- 
Best regards,
Michael


Reply to: