Results.java revision 1390
810N/A * The contents of this file are subject to the terms of the 306N/A * Common Development and Distribution License (the "License"). 306N/A * You may not use this file except in compliance with the License. 306N/A * language governing permissions and limitations under the License. 306N/A * When distributing Covered Code, include this CDDL HEADER in each 306N/A * If applicable, add the following below this CDDL HEADER, with the 306N/A * fields enclosed by brackets "[]" replaced with your own identifying 306N/A * information: Portions Copyright [yyyy] [name of copyright owner] 306N/A * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. 306N/A * Portions Copyright 2011 Jens Elkner. 306N/A * @author Chandan slightly rewritten by Lubos Kosco 636N/A // Util class, should not be constructed 636N/A * Create a has map keyed by the directory of the document found. 636N/A * @param searcher searcher to use. 715N/A * @param hits hits produced by the given searcher's search 715N/A * @param startIdx the index of the first hit to check * @param stopIdx the index of the last hit to check * @return a (directory, hitDocument) hashmap * @throws CorruptIndexException char[]
content =
new char[
1024 *
8];
// Grrrrrrrrrrrrr - TagFilter takes Readers, only!!!! // Why? Is it CS sensible? * Prints out results in html form. The following search helper fields are * required to be properly initialized: * <li>{@link SearchHelper#dataRoot}</li> * <li>{@link SearchHelper#contextPath}</li> * <li>{@link SearchHelper#searcher}</li> * <li>{@link SearchHelper#hits}</li> * <li>{@link SearchHelper#historyContext} (ignored if {@code null})</li> * <li>{@link SearchHelper#sourceContext} (ignored if {@code null})</li> * <li>{@link SearchHelper#summerizer} (if sourceContext is not {@code null})</li> * <li>{@link SearchHelper#sourceRoot} (if sourceContext or historyContext * is not {@code null})</li> * @param out write destination * @param sh search helper which has all required fields set * @param start index of the first hit to print * @param end index of the last hit to print * @throws HistoryException * @throws ClassNotFoundException out.
write(
"<tr class=\"rsd\"><td colspan=\"3\" class=\"rsdl\"><a href=\"");
out.
write(
"<tr><td class=\"rsq\"><a href=\"");
out.
write(
"\" title=\"History\">H</a> <a href=\"");
out.
write(
"?a=true\" title=\"Annotate\">A</a> <a href=\"");
out.
write(
"\" title=\"Download\">D</a>");
out.
write(
"<td class=\"rsf\"><a href=\"");
out.
write(
"</a></td><td><tt class=\"rscon\">");
// FIXME use Highlighter from lucene contrib here, // instead of summarizer, we'd also get rid of // apache lucene in whole source ...