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:
Yonik Seeley 2006-04-03 18:10:09 +00:00
parent 4202b65619
commit d97a9e7adf
1 changed files with 5 additions and 0 deletions

View File

@ -214,6 +214,7 @@ public class SolrTest extends Thread {
static SolrRequestHandler handler =
// new OldRequestHandler();
new StandardRequestHandler();
static String qargs = ""; // default query arguments
public char[] doReq(String req, String params) {
int start=0;
@ -228,6 +229,8 @@ public class SolrTest extends Thread {
args.put("fl", "score");
args.put("version", "2.0");
params = params==null? qargs : (params + '&' + qargs);
if (params != null) {
String[] plist = params.split("&");
for (String decl : plist) {
@ -321,6 +324,8 @@ public class SolrTest extends Thread {
testFile=args[i++];
} else if (arg.equals("-noValidate")) {
doValidate=false;
} else if (arg.equals("-qargs")) {
qargs=args[i++];
} else {
System.out.println("Unknown option: " + arg);
return;