@SuppressWarnings("incomplete-switch")
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/html");
		PrintWriter out = resp.getWriter();
		printHeader(out);
		printBody(out);

		String query = req.getParameter("q");

		try {
			// Query the index.
			Results<ScoredDocument> results = getIndex().search(
					"title:" + query);

			for (ScoredDocument document : results) {
				resp.getWriter().println("<br><br><h3>Document trouvé</h3>");
				for (Field field : document.getFields()) {
					switch (field.getType()) {
					case TEXT:
						out(field.getText(), out);
						break;
					case HTML:
						out(field.getHTML(), out);
						break;
					case ATOM:
						out(field.getAtom(), out);
						break;
					case DATE:
						out(field.getDate().toString(), out);
						break;
					}
				}
			}
		} catch (SearchException e) {
			if (StatusCode.TRANSIENT_ERROR.equals(e.getOperationResult()
					.getCode())) {
				// retry
			}
		}

		resp.getWriter().println("<br><br><br>---Fin");
	}