v1

latestOpenAPI 3.0.1Apache 2.02026-07-13227.1 KB
search

Like /search, but aggregates per package

The search results are currently sorted arbitrarily, but we intend to sort them by ranking eventually: https://github.com/Debian/dcs/blob/51338e934eb7ee18d00c5c18531c0790a83cb698/cmd/dcs-web/querymanager.go#L719

get/searchperpackage

Query parameters

querystring required

The search query, for example who knows... (literal) or who knows\.\.\. (regular expression). See https://codesearch.debian.net/faq for more details about which keywords are supported. The regular expression flavor is RE2, see https://github.com/google/re2/blob/master/doc/syntax.txt

match_mode'literal' | 'regexp'

Whether the query is to be interpreted as a literal (literal) instead of as an RE2 regular expression (regexp). Literal searches are faster and do not require escaping special characters, regular expression searches are more powerful.

Response

All search results

packagestring required

The Debian source package for which up to 2 search results have been aggregated in results.

Example response

[
  {
    "package": "i3-wm_4.18-1",
    "results": [
      {
        "package": "i3-wm_4.18-1",
        "path": "i3bar/src/xcb.c",
        "line": 1313,
        "context_before": [
          "    } else {",
          "        cursor = xcb_generate_id(xcb_connection);"
        ],
        "context": "        i3Font cursor_font = load_font(\"cursor\", false);",
        "context_after": [
          "        xcb_create_glyph_cursor(",
          "            xcb_connection,"
        ]
      }
    ]
  }
]