Logo Search packages:      
Sourcecode: beagle version File versions  Download package

Lucene::Net::QueryParsers::MultiFieldQueryParser Class Reference

Inheritance diagram for Lucene::Net::QueryParsers::MultiFieldQueryParser:

Lucene::Net::QueryParsers::QueryParser

List of all members.


Detailed Description

A QueryParser which constructs queries to search multiple fields.

<author> Kelvin Tan, Daniel Naber </author> <version>

Revision
1.4
</version>

Definition at line 35 of file MultiFieldQueryParser.cs.


Public Member Functions

Query Clause (System.String field)
int Conjunction ()
void Disable_tracing ()
void Enable_tracing ()
virtual ParseException GenerateParseException ()
virtual Analyzer GetAnalyzer ()
virtual Operator GetDefaultOperator ()
 Gets implicit operator setting, which will be either AND_OPERATOR or OR_OPERATOR.
virtual System.String GetField ()
virtual float GetFuzzyMinSim ()
 Get the minimal similarity for fuzzy queries.
virtual int GetFuzzyPrefixLength ()
 Get the prefix length for fuzzy queries.
virtual
System.Globalization.CultureInfo 
GetLocale ()
 Returns current locale, allowing access by subclasses.
virtual bool GetLowercaseExpandedTerms ()
virtual bool GetLowercaseWildcardTerms ()
Token GetNextToken ()
virtual int GetOperator ()
 Gets implicit operator setting, which will be either DEFAULT_OPERATOR_AND or DEFAULT_OPERATOR_OR.
virtual int GetPhraseSlop ()
 Gets the default slop for phrases.
Token GetToken (int index)
int Modifiers ()
 MultiFieldQueryParser (System.String f, Analyzer a)
 MultiFieldQueryParser (CharStream stream)
 MultiFieldQueryParser (QueryParserTokenManager tm)
 MultiFieldQueryParser (System.String[] fields, Analyzer analyzer)
 Creates a MultiFieldQueryParser.
virtual Query Parse (System.String query)
 Parses a query string, returning a Lucene.Net.search.Query.
Query Query (System.String field)
virtual void ReInit (QueryParserTokenManager tm)
virtual void ReInit (CharStream stream)
virtual void SetDefaultOperator (Operator op)
 Sets the boolean operator of the QueryParser. In default mode () terms without any modifiers are considered optional: for example
capital of Hungary
is equal to
capital OR of OR Hungary
.
In mode terms are considered to be in conjuction: the above mentioned query is parsed as
capital AND of AND Hungary
.
virtual void SetFuzzyMinSim (float fuzzyMinSim)
 Set the minimum similarity for fuzzy queries. Default is 0.5f.
virtual void SetFuzzyPrefixLength (int fuzzyPrefixLength)
 Set the prefix length for fuzzy queries. Default is 0.
virtual void SetLocale (System.Globalization.CultureInfo locale)
 Set locale used by date range parsing.
virtual void SetLowercaseExpandedTerms (bool lowercaseExpandedTerms)
 Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is
true
.
virtual void SetLowercaseWildcardTerms (bool lowercaseExpandedTerms)
 Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is
true
.
virtual void SetOperator (int op)
 Sets the boolean operator of the QueryParser. In default mode () terms without any modifiers are considered optional: for example
capital of Hungary
is equal to
capital OR of OR Hungary
.
In terms are considered to be in conjuction: the above mentioned query is parsed as
capital AND of AND Hungary
.
virtual void SetPhraseSlop (int phraseSlop)
 Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero.
Query Term (System.String field)

Static Public Member Functions

static System.String Escape (System.String s)
 Returns a String where those characters that QueryParser expects to be escaped are escaped by a preceding
\
.
static void Main (System.String[] args)
 Command line tool to test QueryParser, using Lucene.Net.analysis.SimpleAnalyzer. Usage:
java Lucene.Net.queryParser.QueryParser &lt;input&gt;
.
static Query Parse (System.String query, System.String field, Analyzer analyzer)
 Parses a query string, returning a Lucene.Net.search.Query.
static Query Parse (System.String[] queries, System.String[] fields, BooleanClause.Occur[] flags, Analyzer analyzer)
 Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited.
static Query Parse (System.String[] queries, System.String[] fields, int[] flags, Analyzer analyzer)
 Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited.
static Query Parse (System.String query, System.String[] fields, BooleanClause.Occur[] flags, Analyzer analyzer)
 Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited.
static Query Parse (System.String query, System.String[] fields, int[] flags, Analyzer analyzer)
 Parses a query, searching on the fields specified. Use this if you need to specify certain fields as required, and others as prohibited.
static Query Parse (System.String[] queries, System.String[] fields, Analyzer analyzer)
 Parses a query which searches on the fields specified.
static Query Parse (System.String query, System.String[] fields, Analyzer analyzer)
 Parses a query which searches on the fields specified. If x fields are specified, this effectively constructs:.

Public Attributes

const int _ESCAPED_CHAR = 2
const int _NUM_CHAR = 1
const int _TERM_CHAR = 4
const int _TERM_START_CHAR = 3
const int _WHITESPACE = 5
const int AND = 7
const int Boost = 0
const int CARAT = 15
const int COLON = 14
const int DEFAULT = 3
const int DEFAULT_OPERATOR_AND = 1
const int DEFAULT_OPERATOR_OR = 0
const int EOF = 0
const int FUZZY_SLOP = 18
Token jj_nt
bool lookingAhead = false
const int LPAREN = 12
const int MINUS = 11
const int NORMAL_FIELD = 0
const int NOT = 9
const int NUMBER = 23
const int OR = 8
const int PLUS = 10
const int PREFIXTERM = 19
const int PROHIBITED_FIELD = 2
const int QUOTED = 16
const int RangeEx = 1
const int RANGEEX_END = 29
const int RANGEEX_GOOP = 31
const int RANGEEX_QUOTED = 30
const int RANGEEX_START = 22
const int RANGEEX_TO = 28
const int RangeIn = 2
const int RANGEIN_END = 25
const int RANGEIN_GOOP = 27
const int RANGEIN_QUOTED = 26
const int RANGEIN_START = 21
const int RANGEIN_TO = 24
const int REQUIRED_FIELD = 1
const int RPAREN = 13
const int TERM = 17
Token token
QueryParserTokenManager token_source
const int WILDTERM = 20

Static Public Attributes

static readonly Operator AND_OPERATOR = Operator.AND
 Alternative form of QueryParser.Operator.AND.
static readonly Operator OR_OPERATOR = Operator.OR
 Alternative form of QueryParser.Operator.OR.
static System.String[] tokenImage = new System.String[]{"<EOF>", "<_NUM_CHAR>", "<_ESCAPED_CHAR>", "<_TERM_START_CHAR>", "<_TERM_CHAR>", "<_WHITESPACE>", "<token of kind 6>", "<AND>", "<OR>", "<NOT>", "\"+\"", "\"-\"", "\"(\"", "\")\"", "\":\"", "\"^\"", "<QUOTED>", "<TERM>", "<FUZZY_SLOP>", "<PREFIXTERM>", "<WILDTERM>", "\"[\"", "\"{\"", "<NUMBER>", "\"TO\"", "\"]\"", "<RANGEIN_QUOTED>", "<RANGEIN_GOOP>", "\"TO\"", "\"}\"", "<RANGEEX_QUOTED>", "<RANGEEX_GOOP>"}

Protected Member Functions

virtual internal void AddClause (System.Collections.ArrayList clauses, int conj, int mods, Query q)
virtual internal Query GetBooleanQuery (System.Collections.ArrayList clauses, bool disableCoord)
 Factory method for generating query, given a set of clauses. By default creates a boolean query composed of clauses passed in.
virtual internal Query GetBooleanQuery (System.Collections.ArrayList clauses)
 Factory method for generating query, given a set of clauses. By default creates a boolean query composed of clauses passed in.
virtual internal Query GetFieldQuery (System.String field, Analyzer analyzer, System.String queryText, int slop)
 Note that parameter analyzer is ignored. Calls inside the parser always use class member analyzer.
internal override Query GetFieldQuery (System.String field, Analyzer analyzer, System.String queryText)
internal override Query GetFieldQuery (System.String field, System.String queryText)
internal override Query GetFieldQuery (System.String field, System.String queryText, int slop)
 Base implementation delegates to GetFieldQuery(String,String). This method may be overridden, for example, to return a SpanNearQuery instead of a PhraseQuery.
internal override Query GetFuzzyQuery (System.String field, System.String termStr, float minSimilarity)
 Factory method for generating a query (similar to getWildcardQuery). Called when parser parses an input term token that has the fuzzy suffix (~) appended.
internal override Query GetFuzzyQuery (System.String field, System.String termStr)
internal override Query GetPrefixQuery (System.String field, System.String termStr)
 Factory method for generating a query (similar to getWildcardQuery). 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.
internal override Query GetRangeQuery (System.String field, System.String part1, System.String part2, bool inclusive)
internal override Query GetRangeQuery (System.String field, Analyzer analyzer, System.String part1, System.String part2, bool inclusive)
internal override Query GetWildcardQuery (System.String field, System.String termStr)
 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).

Private Attributes

System.String[] fields

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index