multifieldqueryparser.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 720 行 · 第 1/4 页
HTML
720 行
<A HREF="../../../../org/apache/lucene/analysis/Analyzer.html" title="class in org.apache.lucene.analysis">Analyzer</A> analyzer)</PRE>
<DL>
<DD>Creates a MultiFieldQueryParser. <p>It will, when parse(String query) is called, construct a query like this (assuming the query consists of two terms and you specify the two fields <code>title</code> and <code>body</code>):</p> <code> (title:term1 body:term1) (title:term2 body:term2) </code> <p>When setDefaultOperator(AND_OPERATOR) is set, the result will be:</p> <code> +(title:term1 body:term1) +(title:term2 body:term2) </code> <p>In other words, all the query's terms must appear, but it doesn't matter in what fields they appear.</p>
<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="getFieldQuery(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
getFieldQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getFieldQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> queryText, int slop) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></B></DD>
<DD>Base implementation delegates to <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getFieldQuery(java.lang.String, java.lang.String)"><CODE>QueryParser.getFieldQuery(String,String)</CODE></A>. This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getFieldQuery(java.lang.String, java.lang.String, int)">getFieldQuery</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></CODE> - throw in overridden method to disallow</DL>
</DD>
</DL>
<HR>
<A NAME="getFieldQuery(java.lang.String, java.lang.String)"><!-- --></A><H3>
getFieldQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getFieldQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> queryText) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getFieldQuery(java.lang.String, java.lang.String)">getFieldQuery</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></CODE> - throw in overridden method to disallow</DL>
</DD>
</DL>
<HR>
<A NAME="getFuzzyQuery(java.lang.String, java.lang.String, float)"><!-- --></A><H3>
getFuzzyQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getFuzzyQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> termStr, float minSimilarity) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></B></DD>
<DD>Factory method for generating a query (similar to <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getWildcardQuery(java.lang.String, java.lang.String)"><CODE>QueryParser.getWildcardQuery(java.lang.String, java.lang.String)</CODE></A>). Called when parser parses an input term token that has the fuzzy suffix (~) appended.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getFuzzyQuery(java.lang.String, java.lang.String, float)">getFuzzyQuery</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - Name of the field query will use.<DD><CODE>termStr</CODE> - Term token to use for building term for the query<DT><B>Returns:</B><DD>Resulting <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search"><CODE>Query</CODE></A> built for the term<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></CODE> - throw in overridden method to disallow</DL>
</DD>
</DL>
<HR>
<A NAME="getPrefixQuery(java.lang.String, java.lang.String)"><!-- --></A><H3>
getPrefixQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getPrefixQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> termStr) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></B></DD>
<DD>Factory method for generating a query (similar to <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getWildcardQuery(java.lang.String, java.lang.String)"><CODE>QueryParser.getWildcardQuery(java.lang.String, java.lang.String)</CODE></A>). Called when parser parses an input term token that uses prefix notation; that is, contains a single '*' wildcard character as its last character. Since this is a special case of generic wildcard term, and such a query can be optimized easily, this usually results in a different query object.<p> Depending on settings, a prefix term may be lower-cased automatically. It will not go through the default Analyzer, however, since normal Analyzers are unlikely to work properly with wildcard templates.<p> Can be overridden by extending classes, to provide custom handling for wild card queries, which may be necessary due to missing analyzer calls.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getPrefixQuery(java.lang.String, java.lang.String)">getPrefixQuery</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - Name of the field query will use.<DD><CODE>termStr</CODE> - Term token to use for building term for the query (<b>without</b> trailing '*' character!)<DT><B>Returns:</B><DD>Resulting <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search"><CODE>Query</CODE></A> built for the term<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></CODE> - throw in overridden method to disallow</DL>
</DD>
</DL>
<HR>
<A NAME="getWildcardQuery(java.lang.String, java.lang.String)"><!-- --></A><H3>
getWildcardQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getWildcardQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> termStr) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></B></DD>
<DD>Factory method for generating a query. Called when parser parses an input term token that contains one or more wildcard characters (? and *), but is not a prefix term token (one that has just a single * character at the end)<p> Depending on settings, prefix term may be lower-cased automatically. It will not go through the default Analyzer, however, since normal Analyzers are unlikely to work properly with wildcard templates.<p> Can be overridden by extending classes, to provide custom handling for wildcard queries, which may be necessary due to missing analyzer calls.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getWildcardQuery(java.lang.String, java.lang.String)">getWildcardQuery</A></CODE> in class <CODE><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html" title="class in org.apache.lucene.queryParser">QueryParser</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - Name of the field query will use.<DD><CODE>termStr</CODE> - Term token that contains one or more wild card characters (? or *), but is not simple prefix term<DT><B>Returns:</B><DD>Resulting <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search"><CODE>Query</CODE></A> built for the term<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></CODE> - throw in overridden method to disallow</DL>
</DD>
</DL>
<HR>
<A NAME="getRangeQuery(java.lang.String, java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>
getRangeQuery</H3>
<PRE>
protected <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> <B>getRangeQuery</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> field, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> part1, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> part2, boolean inclusive) throws <A HREF="../../../../org/apache/lucene/queryParser/ParseException.html" title="class in org.apache.lucene.queryParser">ParseException</A></PRE>
<DL>
<DD><DL>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?