public interface QueryParser extends QueryParser
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_OPERATOR |
static int |
DEFAULT_PHRASE_SLOP |
static int |
OPERATOR_AND |
static int |
OPERATOR_OR |
Modifier and Type | Method and Description |
---|---|
int |
getOperator()
Get's the operator
|
int |
getPhraseSlop()
Gets the default slop for phrases.
|
org.apache.lucene.search.Query |
parse(java.lang.String query)
Parses a query string, returning a
Query.
|
void |
setOperator(int i)
Set the boolean operator of the QueryParser.
|
void |
setPhraseSlop(int i)
Sets the default slop for phrases.
|
void |
setUp(Analyzer a,
int phraseSlop,
int operator)
Sets the fields of the query parser
|
void |
setUp(java.lang.String f,
Analyzer a)
Sets the fields of the query parser
|
void |
setUp(java.lang.String f,
Analyzer a,
int phraseSlop,
int operator)
Sets the fields of the query parser
|
void |
setUp(java.lang.String f,
Analyzer a,
SearchLocations sl,
int phraseSlop,
int operator)
Sets the fields of the query parser
|
static final int DEFAULT_OPERATOR
static final int OPERATOR_OR
static final int OPERATOR_AND
static final int DEFAULT_PHRASE_SLOP
void setUp(java.lang.String f, Analyzer a)
f
- the default field for query terms.a
- used to find terms in the query text.void setUp(Analyzer a, int phraseSlop, int operator)
a
- used to find terms in the query text.phraseSlop
- the slopoperator
- the operatorvoid setUp(java.lang.String f, Analyzer a, int phraseSlop, int operator)
f
- the default field for query terms.a
- used to find terms in the query text.phraseSlop
- the slopoperator
- the operatorvoid setUp(java.lang.String f, Analyzer a, SearchLocations sl, int phraseSlop, int operator)
f
- the default field for query terms.a
- used to find terms in the query text.sl
- SearchLocationsphraseSlop
- the slopoperator
- the operatororg.apache.lucene.search.Query parse(java.lang.String query) throws ParseException, TokenMgrError
query
- the query string to be parsed.ParseException
- if the parsing failsTokenMgrError
- if ther parsing failsint getOperator()
int getPhraseSlop()
void setOperator(int i)
DEFAULT_OPERATOR_OR) terms without any modifiers
are considered optional: for example capital of Hungary
is equal to
capital OR of OR Hungary
.
In DEFAULT_OPERATOR_AND
terms are considered to be in conjuction: the
above mentioned query is parsed as capital AND of AND Hungary
void setPhraseSlop(int i)
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.