SOLR-3304 Solr adapters for the new Lucene 4 spatial module

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1386458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2012-09-17 03:19:03 +00:00
parent bf05f70a0b
commit 7ac90a792e
1 changed files with 5 additions and 2 deletions

View File

@ -45,6 +45,9 @@ import java.util.StringTokenizer;
*/
public class SpatialArgsParser {
public static final String DIST_ERR_PCT = "distErrPct";
public static final String DIST_ERR = "distErr";
/** Writes a close approximation to the parsed input format. */
static String writeSpatialArgs(SpatialArgs args) {
StringBuilder str = new StringBuilder();
@ -90,8 +93,8 @@ public class SpatialArgsParser {
body = v.substring(edx + 1).trim();
if (body.length() > 0) {
Map<String, String> aa = parseMap(body);
args.setDistErrPct(readDouble(aa.remove("distErrPct")));
args.setDistErr(readDouble(aa.remove("distErr")));
args.setDistErrPct(readDouble(aa.remove(DIST_ERR_PCT)));
args.setDistErr(readDouble(aa.remove(DIST_ERR)));
if (!aa.isEmpty()) {
throw new IllegalArgumentException("unused parameters: " + aa, null);
}