mirror of https://github.com/apache/lucene.git
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:
parent
bf05f70a0b
commit
7ac90a792e
|
@ -45,6 +45,9 @@ import java.util.StringTokenizer;
|
||||||
*/
|
*/
|
||||||
public class SpatialArgsParser {
|
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. */
|
/** Writes a close approximation to the parsed input format. */
|
||||||
static String writeSpatialArgs(SpatialArgs args) {
|
static String writeSpatialArgs(SpatialArgs args) {
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
|
@ -90,8 +93,8 @@ public class SpatialArgsParser {
|
||||||
body = v.substring(edx + 1).trim();
|
body = v.substring(edx + 1).trim();
|
||||||
if (body.length() > 0) {
|
if (body.length() > 0) {
|
||||||
Map<String, String> aa = parseMap(body);
|
Map<String, String> aa = parseMap(body);
|
||||||
args.setDistErrPct(readDouble(aa.remove("distErrPct")));
|
args.setDistErrPct(readDouble(aa.remove(DIST_ERR_PCT)));
|
||||||
args.setDistErr(readDouble(aa.remove("distErr")));
|
args.setDistErr(readDouble(aa.remove(DIST_ERR)));
|
||||||
if (!aa.isEmpty()) {
|
if (!aa.isEmpty()) {
|
||||||
throw new IllegalArgumentException("unused parameters: " + aa, null);
|
throw new IllegalArgumentException("unused parameters: " + aa, null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue