show: make highlight legible
[debiancodesearch.git] / static / faq.html
blob46ca4ef62988747355512cf77498d600b987518c
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <title>Debian Code Search</title>
6 <link rel="stylesheet" href="debcodesearch.min.css">
7 </head>
8 <body>
10 <div id="header">
11 <div id="upperheader">
12 <div id="logo">
13 <a href="/" title="Debian Home"><img src="/Pics/openlogo-50.svg" alt="Debian" width="50" height="61"></a>
14 </div> <!-- end logo -->
15 <p class="section"><a href="/">Code Search</a></p>
16 </div> <!-- end upperheader -->
17 <!--UdmComment-->
18 <div id="navbar">
19 <p class="hidecss"><a href="#content">Skip Quicknav</a></p>
20 <ul>
21 <li><a href="./">Search</a></li>
22 <li><a href="./about">About Code Search</a></li>
23 <li><a href="./faq">FAQ</a></li>
24 </ul>
25 </div> <!-- end navbar -->
26 <p id="breadcrumbs">&nbsp; frequently asked questions</p>
27 </div> <!-- end header -->
28 <!--/UdmComment-->
29 <div id="content">
31 <h1>Debian Code Search FAQ</h1>
33 <a id="keywords"><h2>Q: What kind of keywords can I use in the search field?</h2></a>
35 <p>
36 Each keyword must be specified as "<tt>type:value</tt>", without additional spaces.<br>
37 Keywords are separated from search terms by space, e.g. "<tt>printf filetype:c</tt>".
38 </p>
40 <p>
41 All keywords can be negated, e.g. “<tt>xcb_create_window -filetype:c</tt>”.
42 </p>
44 <dl>
45 <dt><tt>filetype</tt></dt>
46 <dd>
47 Filters file names according to their extension.<br>
48 To find source code dealing with XMPP written in Perl, you could search for "<tt>XMPP
49 filetype:perl</tt>".<br>
50 The currently supported file types are c, c++, objc, objc++, perl, python, go, java, ruby, shell, vala, javascript, json.
51 </dd>
52 <dt><tt>package</tt> (or <tt>pkg</tt>)</dt>
53 <dd>
54 Searches only within the specified Debian source packages (using regular expressions).<br>
55 To find all calls to <tt>xcb_create_window</tt> which the window manager i3 does, you could search for "<tt>xcb_create_window package:i3-wm</tt>".<br>
56 </dd>
57 <dt><tt>path</tt></dt>
58 <dd>
59 Searches only files that match the given path (using regular expressions).<br>
60 To find only matches within Debian packaging, use e.g. "<tt>systemctl path:debian/</tt>".<br>
61 To find only matches within the libi3 folder of any version of i3-wm, use "<tt>i3Font path:i3-wm_.*/libi3/</tt>".
62 </dl>
64 <a id="regexp"><h2>Q: Can I use regular expressions?</h2></a>
66 <p>
67 Why yes! The full syntax is described
68 at <a href="https://github.com/google/re2/blob/main/doc/syntax.txt">RE2:Syntax</a>. Be
69 sure to switch the search mode from “literal” to “regex”.
70 </p>
72 <h2>Q: Where is the source code of DCS?</h2>
74 <p>
75 You can find the source at <a
76 href="https://github.com/Debian/dcs">github.com/Debian/dcs</a>
77 </p>
79 <h2>Q: Which Debian distributions are indexed (e.g. testing, sid, experimental)?</h2>
81 <p>
82 Currently, DCS indexes sid only. If you have good arguments for extending or
83 changing this, please let us know. Consider that including multiple versions of
84 the source will lead to more search results from “the same” code.
85 </p>
87 <h2>Q: How long does it take until new code is indexed?</h2>
89 <p>
90 Once a source package is uploaded to ftp-master, we fetch it and start the
91 indexing process typically within a couple of minutes (in the worst case, it
92 will take up to an hour until we see the package). Then, it typically takes
93 another couple of minutes until the index was rebuilt and is live. All in all,
94 expect to see new source code being searchable about an hour or two after it
95 was uploaded.
96 </p>
98 <h2>I want to use the code search service in my own project, is there an official API?</h2>
101 Yes! See <a href="https://codesearch.debian.net/apikeys/">Debian Code Search API keys</a>.
102 </p>
105 We have a list of <a href="./thirdparty">third party projects</a>, which use Debian Code Search.
106 </p>
108 <a name="emptyindex">
109 <h2>Q: Why does my regular expression query error out with “Empty index query”?</h2>
110 </a>
113 This error message is returned when the regexp code cannot finding enough
114 consecutive non-optional characters to construct any trigrams to query the
115 index with. In other words: your search query is too short, or not specific
116 enough. Try making your search query longer. See
117 also <a href="https://github.com/Debian/dcs/issues/110">issue #110</a> for a
118 specific example.
119 </p>
121 </div>
122 <div id="footer">
123 <hr>
124 <!--UdmComment-->
125 <div id="fineprint">
126 <p>© 2012-2016 Debian Code Search - <a href="/contact" rel="nofollow">Contact / Send Feedback</a></p>
127 </div>
128 <!--/UdmComment-->
129 </div> <!-- end footer -->
130 </body>
131 </html>