mirror of https://github.com/apache/lucene.git
ability to specify/override query parameters from command line
git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@391099 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4202b65619
commit
d97a9e7adf
|
@ -214,6 +214,7 @@ public class SolrTest extends Thread {
|
||||||
static SolrRequestHandler handler =
|
static SolrRequestHandler handler =
|
||||||
// new OldRequestHandler();
|
// new OldRequestHandler();
|
||||||
new StandardRequestHandler();
|
new StandardRequestHandler();
|
||||||
|
static String qargs = ""; // default query arguments
|
||||||
|
|
||||||
public char[] doReq(String req, String params) {
|
public char[] doReq(String req, String params) {
|
||||||
int start=0;
|
int start=0;
|
||||||
|
@ -228,6 +229,8 @@ public class SolrTest extends Thread {
|
||||||
args.put("fl", "score");
|
args.put("fl", "score");
|
||||||
args.put("version", "2.0");
|
args.put("version", "2.0");
|
||||||
|
|
||||||
|
params = params==null? qargs : (params + '&' + qargs);
|
||||||
|
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
String[] plist = params.split("&");
|
String[] plist = params.split("&");
|
||||||
for (String decl : plist) {
|
for (String decl : plist) {
|
||||||
|
@ -321,6 +324,8 @@ public class SolrTest extends Thread {
|
||||||
testFile=args[i++];
|
testFile=args[i++];
|
||||||
} else if (arg.equals("-noValidate")) {
|
} else if (arg.equals("-noValidate")) {
|
||||||
doValidate=false;
|
doValidate=false;
|
||||||
|
} else if (arg.equals("-qargs")) {
|
||||||
|
qargs=args[i++];
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Unknown option: " + arg);
|
System.out.println("Unknown option: " + arg);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue