📄 package-summary.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_04) on Wed Feb 14 11:49:16 EST 2007 -->
<TITLE>
org.apache.lucene.search.spans (Lucene 2.1.0 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.lucene.search.spans package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="org.apache.lucene.search.spans (Lucene 2.1.0 API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/lucene/search/regex/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../org/apache/lucene/search/spell/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>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<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_top"></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
Package org.apache.lucene.search.spans
</H2>
The calculus of spans.
<P>
<B>See:</B>
<BR>
<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/Spans.html" title="interface in org.apache.lucene.search.spans">Spans</A></B></TD>
<TD>Expert: an enumeration of span matches.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanFirstQuery.html" title="class in org.apache.lucene.search.spans">SpanFirstQuery</A></B></TD>
<TD>Matches spans near the beginning of a field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanNearQuery.html" title="class in org.apache.lucene.search.spans">SpanNearQuery</A></B></TD>
<TD>Matches spans which are near one another.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanNotQuery.html" title="class in org.apache.lucene.search.spans">SpanNotQuery</A></B></TD>
<TD>Removes matches which overlap with another SpanQuery.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanOrQuery.html" title="class in org.apache.lucene.search.spans">SpanOrQuery</A></B></TD>
<TD>Matches the union of its clauses.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanQuery.html" title="class in org.apache.lucene.search.spans">SpanQuery</A></B></TD>
<TD>Base class for span-based queries.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/lucene/search/spans/SpanTermQuery.html" title="class in org.apache.lucene.search.spans">SpanTermQuery</A></B></TD>
<TD>Matches spans containing a term.</TD>
</TR>
</TABLE>
<P>
<A NAME="package_description"><!-- --></A><H2>
Package org.apache.lucene.search.spans Description
</H2>
<P>
The calculus of spans.<p>A span is a <code><doc,startPosition,endPosition></code> tuple.</p><p>The following span query operators are implemented:<ul><li>A <a href="SpanTermQuery.html">SpanTermQuery</a> matches all spanscontaining a particular <a href="../../index/Term.html">Term</a>.</li><li> A <a href="SpanNearQuery.html">SpanNearQuery</a> matches spanswhich occur near one another, and can be used to implement things likephrase search (when constructed from <ahref="SpanTermQuery.html">SpanTermQueries</a>) and inter-phraseproximity (when constructed from other <ahref="SpanNearQuery.html">SpanNearQueries</a>).</li><li>A <a href="SpanOrQuery.html">SpanOrQuery</a> merges spans from anumber of other <a href="SpanQuery.html">SpanQueries</a>.</li><li>A <a href="SpanNotQuery.html">SpanNotQuery</a> removes spansmatching one <a href="SpanQuery.html">SpanQuery</a> which overlapanother. This can be used, e.g., to implement within-paragraphsearch.</li><li>A <a href="SpanFirstQuery.html">SpanFirstQuery</a> matches spansmatching <code>q</code> whose end position is less than<code>n</code>. This can be used to constrain matches to the firstpart of the document.</li></ul>In all cases, output spans are minimally inclusive. In other words, aspan formed by matching a span in x and y starts at the lesser of thetwo starts and ends at the greater of the two ends.</p><p>For example, a span query which matches "John Kerry" within tenwords of "George Bush" within the first 100 words of the documentcould be constructed with:<pre>SpanQuery john = new SpanTermQuery(new Term("content", "john"));SpanQuery kerry = new SpanTermQuery(new Term("content", "kerry"));SpanQuery george = new SpanTermQuery(new Term("content", "george"));SpanQuery bush = new SpanTermQuery(new Term("content", "bush"));SpanQuery johnKerry = new SpanNearQuery(new SpanQuery[] {john, kerry}, 0, true);SpanQuery georgeBush = new SpanNearQuery(new SpanQuery[] {george, bush}, 0, true);SpanQuery johnKerryNearGeorgeBush = new SpanNearQuery(new SpanQuery[] {johnKerry, georgeBush}, 10, false);SpanQuery johnKerryNearGeorgeBushAtStart = new SpanFirstQuery(johnKerryNearGeorgeBush, 100);</pre><p>Span queries may be freely intermixed with other Lucene queries.So, for example, the above query can be restricted to documents whichalso use the word "iraq" with:<pre>Query query = new BooleanQuery();query.add(johnKerryNearGeorgeBushAtStart, true, false);query.add(new TermQuery("content", "iraq"), true, false);</pre>
<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> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/lucene/search/regex/package-summary.html"><B>PREV PACKAGE</B></A>
<A HREF="../../../../../org/apache/lucene/search/spell/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>
<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
<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 © 2000-2007 Apache Software Foundation. All Rights Reserved.
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -