package-summary.html

来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 309 行 · 第 1/2 页

HTML
309
字号
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/SimpleHTMLFormatter.html" title="class in org.apache.lucene.search.highlight">SimpleHTMLFormatter</A></B></TD>
<TD>Simple <A HREF="../../../../../org/apache/lucene/search/highlight/Formatter.html" title="interface in org.apache.lucene.search.highlight"><CODE>Formatter</CODE></A> implementation to highlight terms with a pre and post tag</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/SpanGradientFormatter.html" title="class in org.apache.lucene.search.highlight">SpanGradientFormatter</A></B></TD>
<TD>Formats text with different color intensity depending on the score of the term using the span tag.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/TextFragment.html" title="class in org.apache.lucene.search.highlight">TextFragment</A></B></TD>
<TD>Low-level class used to record information about a section of a document  with a score.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/TokenGroup.html" title="class in org.apache.lucene.search.highlight">TokenGroup</A></B></TD>
<TD>One, or several overlapping tokens, along with the score(s) and the scope of the original text</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/TokenSources.html" title="class in org.apache.lucene.search.highlight">TokenSources</A></B></TD>
<TD>Hides implementation issues associated with obtaining a TokenStream for use with the higlighter - can obtain from TermFreqVectors with offsets and (optionally) positions or from Analyzer class reparsing the stored content.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/highlight/WeightedTerm.html" title="class in org.apache.lucene.search.highlight">WeightedTerm</A></B></TD>
<TD>Lightweight class to hold term and a weight value used for scoring this term</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package org.apache.lucene.search.highlight Description
</H2>

<P>
The highlight package contains classes to provide "keyword in context" featurestypically used to highlight search terms in the text of results pages.The Highlighter class is the central component and can be used to extract themost interesting sections of a piece of text and highlight them, with the help ofFragmenter, FragmentScorer, Formatter classes.<h2>Example Usage</h2><pre>	IndexSearcher searcher = new IndexSearcher(ramDir);	Query query = QueryParser.parse("Kenne*", FIELD_NAME, analyzer);	query = query.rewrite(reader); //required to expand search terms	Hits hits = searcher.search(query);	Highlighter highlighter = new Highlighter(this, new QueryScorer(query));	for (int i = 0; i &lt; hits.length(); i++)	{		String text = hits.doc(i).get(FIELD_NAME);		TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new StringReader(text));		// Get 3 best fragments and seperate with a "..."		String result = highlighter.getBestFragments(tokenStream, text, 3, "...");		System.out.println(result);	}</pre><h2>New features 06/02/2005</h2>This release adds options for encoding (thanks to Nicko Cadell).An "Encoder" implementation such as the new SimpleHTMLEncoder class can be passed to the highlighter to encodeall those non-xhtml standard characters such as &amp; into legal values. This simple class may not suffice forsome languages -  Commons Lang has an implementation that could be used: escapeHtml(String) inhttp://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java?rev=137958&view=markup<h2>New features 22/12/2004</h2>This release adds some new capabilities:<ol>	<li>Faster highlighting using Term vector support</li>	<li>New formatting options to use color intensity to show informational value</li>	<li>Options for better summarization by using term IDF scores to influence fragment selection</li></ol><p>The highlighter takes a TokenStream as input. Until now these streams have typically been producedusing an Analyzer but the new class TokenSources provides helper methods for obtaining TokenStreams fromthe new TermVector position support (see latest CVS version).</p><p>The new class GradientFormatter can use a scale of colors to highlight terms according to their score.A subtle use of color can help emphasise the reasons for matching (useful when doing "MoreLikeThis" queries andyou want to see what the basis of the similarities are).</p><p>The QueryScorer class has a new constructor which can use an IndexReader to derive the IDF (inverse document frequency)for each term in order to influcence the score. This is useful for helping to extracting the most significant sectionsof a document and in supplying scores used by the new GradientFormatter to color significant words more strongly.The QueryScorer.getMaxWeight method is useful when passed to the GradientFormatter constructor to define the top scorewhich is associated with the top color.</p>
<P>

<P>
<HR>

<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/lucene/search/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/lucene/search/regex/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &copy; 2000-2007 Apache Software Foundation.  All Rights Reserved.
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?