queryparser.html
来自「 Lucene是apache软件基金会[4] jakarta项目组的一个子项目」· HTML 代码 · 共 1,243 行 · 第 1/5 页
HTML
1,243 行
are considered optional: for example <code>capital of Hungary</code> is equal to <code>capital OR of OR Hungary</code>.<br/> In <code>AND_OPERATOR</code> mode terms are considered to be in conjuction: the above mentioned query is parsed as <code>capital AND of AND Hungary</code>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDefaultOperator()"><!-- --></A><H3>
getDefaultOperator</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.Operator.html" title="class in org.apache.lucene.queryParser">QueryParser.Operator</A> <B>getDefaultOperator</B>()</PRE>
<DL>
<DD>Gets implicit operator setting, which will be either AND_OPERATOR or OR_OPERATOR.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setLowercaseExpandedTerms(boolean)"><!-- --></A><H3>
setLowercaseExpandedTerms</H3>
<PRE>
public void <B>setLowercaseExpandedTerms</B>(boolean lowercaseExpandedTerms)</PRE>
<DL>
<DD>Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is <code>true</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getLowercaseExpandedTerms()"><!-- --></A><H3>
getLowercaseExpandedTerms</H3>
<PRE>
public boolean <B>getLowercaseExpandedTerms</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#setLowercaseExpandedTerms(boolean)"><CODE>setLowercaseExpandedTerms(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setUseOldRangeQuery(boolean)"><!-- --></A><H3>
setUseOldRangeQuery</H3>
<PRE>
public void <B>setUseOldRangeQuery</B>(boolean useOldRangeQuery)</PRE>
<DL>
<DD>By default QueryParser uses new ConstantScoreRangeQuery in preference to RangeQuery for range queries. This implementation is generally preferable because it a) Runs faster b) Does not have the scarcity of range terms unduly influence score c) avoids any "TooManyBooleanClauses" exception. However, if your application really needs to use the old-fashioned RangeQuery and the above points are not required then set this option to <code>true</code> Default is <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getUseOldRangeQuery()"><!-- --></A><H3>
getUseOldRangeQuery</H3>
<PRE>
public boolean <B>getUseOldRangeQuery</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#setUseOldRangeQuery(boolean)"><CODE>setUseOldRangeQuery(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setLocale(java.util.Locale)"><!-- --></A><H3>
setLocale</H3>
<PRE>
public void <B>setLocale</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> locale)</PRE>
<DL>
<DD>Set locale used by date range parsing.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getLocale()"><!-- --></A><H3>
getLocale</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> <B>getLocale</B>()</PRE>
<DL>
<DD>Returns current locale, allowing access by subclasses.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setDateResolution(org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
setDateResolution</H3>
<PRE>
public void <B>setDateResolution</B>(<A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> dateResolution)</PRE>
<DL>
<DD>Sets the default date resolution used by RangeQueries for fields for which no specific date resolutions has been set. Field specific resolutions can be set with <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#setDateResolution(java.lang.String, org.apache.lucene.document.DateTools.Resolution)"><CODE>setDateResolution(String, DateTools.Resolution)</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateResolution</CODE> - the default date resolution to set</DL>
</DD>
</DL>
<HR>
<A NAME="setDateResolution(java.lang.String, org.apache.lucene.document.DateTools.Resolution)"><!-- --></A><H3>
setDateResolution</H3>
<PRE>
public void <B>setDateResolution</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> fieldName, <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> dateResolution)</PRE>
<DL>
<DD>Sets the date resolution used by RangeQueries for a specific field.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateResolution</CODE> - date resolution to set</DL>
</DD>
</DL>
<HR>
<A NAME="getDateResolution(java.lang.String)"><!-- --></A><H3>
getDateResolution</H3>
<PRE>
public <A HREF="../../../../org/apache/lucene/document/DateTools.Resolution.html" title="class in org.apache.lucene.document">DateTools.Resolution</A> <B>getDateResolution</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> fieldName)</PRE>
<DL>
<DD>Returns the date resolution that is used by RangeQueries for the given field. Returns null, if no default or field specific date resolution has been set for the given field.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addClause(java.util.Vector, int, int, org.apache.lucene.search.Query)"><!-- --></A><H3>
addClause</H3>
<PRE>
protected void <B>addClause</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Vector.html" title="class or interface in java.util">Vector</A> clauses, int conj, int mods, <A HREF="../../../../org/apache/lucene/search/Query.html" title="class in org.apache.lucene.search">Query</A> q)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</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>
</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, 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>Base implementation delegates to <A HREF="../../../../org/apache/lucene/queryParser/QueryParser.html#getFieldQuery(java.lang.String, java.lang.String)"><CODE>getFieldQuery(String,String)</CODE></A>. This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.
<P>
<DD><DL>
</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="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> par
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?