⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phrasequery.html

📁  Lucene是apache软件基金会[4] jakarta项目组的一个子项目
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</TR>
</TABLE>

<A NAME="PhraseQuery()"><!-- --></A><H3>
PhraseQuery</H3>
<PRE>
public <B>PhraseQuery</B>()</PRE>
<DL>
<DD>Constructs an empty phrase query.
<P>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="setSlop(int)"><!-- --></A><H3>
setSlop</H3>
<PRE>
public void <B>setSlop</B>(int&nbsp;s)</PRE>
<DL>
<DD>Sets the number of other words permitted between words in query phrase.    If zero, then this is an exact phrase search.  For larger values this works    like a <code>WITHIN</code> or <code>NEAR</code> operator.    <p>The slop is in fact an edit-distance, where the units correspond to    moves of terms in the query phrase out of position.  For example, to switch    the order of two words requires two moves (the first move places the words    atop one another), so to permit re-orderings of phrases, the slop must be    at least two.    <p>More exact matches are scored higher than sloppier matches, thus search    results are sorted by exactness.    <p>The slop is zero by default, requiring exact matches.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getSlop()"><!-- --></A><H3>
getSlop</H3>
<PRE>
public int <B>getSlop</B>()</PRE>
<DL>
<DD>Returns the slop.  See setSlop().
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(org.apache.lucene.index.Term)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A>&nbsp;term)</PRE>
<DL>
<DD>Adds a term to the end of the query phrase. The relative position of the term is the one immediately after the last term added.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="add(org.apache.lucene.index.Term, int)"><!-- --></A><H3>
add</H3>
<PRE>
public void <B>add</B>(<A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A>&nbsp;term,                int&nbsp;position)</PRE>
<DL>
<DD>Adds a term to the end of the query phrase. The relative position of the term within the phrase is specified explicitly. This allows e.g. phrases with more than one term at the same position or phrases with gaps (e.g. in connection with stopwords).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>term</CODE> - <DD><CODE>position</CODE> - </DL>
</DD>
</DL>
<HR>

<A NAME="getTerms()"><!-- --></A><H3>
getTerms</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</A>[] <B>getTerms</B>()</PRE>
<DL>
<DD>Returns the set of terms in this phrase.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getPositions()"><!-- --></A><H3>
getPositions</H3>
<PRE>
public int[] <B>getPositions</B>()</PRE>
<DL>
<DD>Returns the relative positions of terms in this phrase.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="createWeight(org.apache.lucene.search.Searcher)"><!-- --></A><H3>
createWeight</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Weight.html" title="interface in org.apache.lucene.search">Weight</A> <B>createWeight</B>(<A HREF="../../../../org/apache/lucene/search/Searcher.html" title="class in org.apache.lucene.search">Searcher</A>&nbsp;searcher)                       throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A></CODE></B></DD>
<DD>Expert: Constructs an appropriate Weight implementation for this query. <p>Only implemented by primitive queries, which re-write to themselves.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Query.html#createWeight(org.apache.lucene.search.Searcher)">createWeight</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="extractTerms(java.util.Set)"><!-- --></A><H3>
extractTerms</H3>
<PRE>
public void <B>extractTerms</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Set.html" title="class or interface in java.util">Set</A>&nbsp;queryTerms)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A></CODE></B></DD>
<DD>Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its <A HREF="../../../../org/apache/lucene/search/Query.html#rewrite(org.apache.lucene.index.IndexReader)"><CODE>rewritten</CODE></A> form.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Query.html#extractTerms(java.util.Set)">extractTerms</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/search/Query.html#extractTerms(java.util.Set)"><CODE>Query.extractTerms(java.util.Set)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="toString(java.lang.String)"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;f)</PRE>
<DL>
<DD>Prints a user-readable version of this query.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/lucene/search/Query.html#toString(java.lang.String)">toString</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
<DL>
<DD>Returns true iff <code>o</code> is equal to this.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD>Returns a hash code value for this object.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/PhraseQuery.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/ParallelMultiSearcher.html" title="class in org.apache.lucene.search"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/lucene/search/PrefixFilter.html" title="class in org.apache.lucene.search"><B>NEXT CLASS</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="PhraseQuery.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -