|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.search.QParser
public abstract class QParser
Note: This API is experimental and may change in non backward-compatible ways in the future
Field Summary | |
---|---|
protected org.apache.solr.common.params.SolrParams |
localParams
|
protected org.apache.solr.common.params.SolrParams |
params
|
protected String |
qstr
|
protected Query |
query
|
protected int |
recurseCount
|
protected SolrQueryRequest |
req
|
Constructor Summary | |
---|---|
QParser(String qstr,
org.apache.solr.common.params.SolrParams localParams,
org.apache.solr.common.params.SolrParams params,
SolrQueryRequest req)
|
Method Summary | |
---|---|
void |
addDebugInfo(org.apache.solr.common.util.NamedList<Object> debugInfo)
|
String[] |
getDefaultHighlightFields()
|
Query |
getHighlightQuery()
|
org.apache.solr.common.params.SolrParams |
getLocalParams()
|
protected String |
getParam(String name)
check both local and global params |
org.apache.solr.common.params.SolrParams |
getParams()
|
static QParser |
getParser(String qstr,
String defaultType,
SolrQueryRequest req)
Create a QParser to parse qstr ,
assuming that the default query type is defaultType . |
Query |
getQuery()
Returns the resulting query from this QParser, calling parse() only the first time and caching the Query result. |
SolrQueryRequest |
getReq()
|
SortSpec |
getSort(boolean useGlobalParams)
|
String |
getString()
|
abstract Query |
parse()
Create and return the Query object represented by qstr |
void |
setLocalParams(org.apache.solr.common.params.SolrParams localParams)
|
void |
setParams(org.apache.solr.common.params.SolrParams params)
|
void |
setReq(SolrQueryRequest req)
|
void |
setString(String s)
|
QParser |
subQuery(String q,
String defaultType)
Create a new QParser for parsing an embedded sub-query |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String qstr
protected org.apache.solr.common.params.SolrParams params
protected org.apache.solr.common.params.SolrParams localParams
protected SolrQueryRequest req
protected int recurseCount
protected Query query
Constructor Detail |
---|
public QParser(String qstr, org.apache.solr.common.params.SolrParams localParams, org.apache.solr.common.params.SolrParams params, SolrQueryRequest req)
Method Detail |
---|
public abstract Query parse() throws ParseException
Query
object represented by qstr
ParseException
getQuery()
public org.apache.solr.common.params.SolrParams getLocalParams()
public void setLocalParams(org.apache.solr.common.params.SolrParams localParams)
public org.apache.solr.common.params.SolrParams getParams()
public void setParams(org.apache.solr.common.params.SolrParams params)
public SolrQueryRequest getReq()
public void setReq(SolrQueryRequest req)
public String getString()
public void setString(String s)
public Query getQuery() throws ParseException
ParseException
protected String getParam(String name)
public QParser subQuery(String q, String defaultType) throws ParseException
ParseException
public SortSpec getSort(boolean useGlobalParams) throws ParseException
useGlobalParams
- look up sort, start, rows in global params if not in local params
ParseException
public String[] getDefaultHighlightFields()
public Query getHighlightQuery() throws ParseException
ParseException
public void addDebugInfo(org.apache.solr.common.util.NamedList<Object> debugInfo)
public static QParser getParser(String qstr, String defaultType, SolrQueryRequest req) throws ParseException
QParser
to parse qstr
,
assuming that the default query type is defaultType
.
The query type may be overridden by local parameters in the query
string itself. For example if defaultType="dismax"
and qstr=foo
, then the dismax query parser will be used
to parse and construct the query object. However
if qstr={!prefix f=myfield}foo
then the prefix query parser will be used.
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |