public class QueryParsing extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFTYPE |
static String |
F |
static char |
LOCALPARAM_END |
static String |
LOCALPARAM_START |
static String |
OP |
static String |
SPLIT_ON_WHITESPACE |
static String |
TYPE |
static String |
V |
static String |
VAL_EXPLICIT |
Constructor and Description |
---|
QueryParsing() |
Modifier and Type | Method and Description |
---|---|
static SolrParams |
getLocalParams(String txt,
SolrParams params)
"foo" returns null
"{!prefix f=myfield}yes" returns type="prefix",f="myfield",v="yes"
"{!prefix f=myfield v=$p}" returns type="prefix",f="myfield",v=params.get("p")
|
static int |
parseLocalParams(String txt,
int start,
ModifiableSolrParams target,
SolrParams params) |
static int |
parseLocalParams(String txt,
int start,
ModifiableSolrParams target,
SolrParams params,
String startString,
char endChar) |
static QueryParser.Operator |
parseOP(String operator)
Parses default operator string into Operator object
|
static List<String> |
toString(List<Query> queries,
IndexSchema schema)
Builds a list of String which are stringified versions of a list of Queries
|
static String |
toString(Query query,
IndexSchema schema)
Formats a Query for debugging, using the IndexSchema to make
complex field types readable.
|
static void |
toString(Query query,
IndexSchema schema,
Appendable out,
int flags) |
public static final String OP
public static final String V
public static final String F
public static final String TYPE
public static final String DEFTYPE
public static final String SPLIT_ON_WHITESPACE
public static final String LOCALPARAM_START
public static final char LOCALPARAM_END
public static final String VAL_EXPLICIT
public static int parseLocalParams(String txt, int start, ModifiableSolrParams target, SolrParams params) throws SyntaxError
txt
- Text to parsestart
- Index into text for start of parsingtarget
- Object to inject with parsed settingsparams
- Additional existing parametersSyntaxError
public static int parseLocalParams(String txt, int start, ModifiableSolrParams target, SolrParams params, String startString, char endChar) throws SyntaxError
txt
- Text to parsestart
- Index into text for start of parsingtarget
- Object to inject with parsed settingsparams
- Additional existing parametersstartString
- String that indicates the start of a localParams sectionendChar
- Character that indicates the end of a localParams sectionSyntaxError
public static SolrParams getLocalParams(String txt, SolrParams params) throws SyntaxError
SyntaxError
public static void toString(Query query, IndexSchema schema, Appendable out, int flags) throws IOException
IOException
toString(Query,IndexSchema)
public static String toString(Query query, IndexSchema schema)
The benefit of using this method instead of calling
Query.toString
directly is that it knows about the data
types of each field, so any field which is encoded in a particularly
complex way is still readable. The downside is that it only knows
about built in Query types, and will not be able to format custom
Query classes.
public static List<String> toString(List<Query> queries, IndexSchema schema)
public static QueryParser.Operator parseOP(String operator)
operator
- the string from requestCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.