Do not fail if providing coordinates for same field name
This commit is contained in:
parent
46e4ea9d16
commit
778a447ef0
|
@ -434,7 +434,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
||||||
nestedFilter = context.parseInnerQueryBuilder();
|
nestedFilter = context.parseInnerQueryBuilder();
|
||||||
} else {
|
} else {
|
||||||
// the json in the format of -> field : { lat : 30, lon : 12 }
|
// the json in the format of -> field : { lat : 30, lon : 12 }
|
||||||
if (fieldName != null) {
|
if (fieldName != null && fieldName.equals(currentName) == false) {
|
||||||
throw new ParsingException(
|
throw new ParsingException(
|
||||||
parser.getTokenLocation(),
|
parser.getTokenLocation(),
|
||||||
"Trying to reset fieldName to [{}], already set to [{}].",
|
"Trying to reset fieldName to [{}], already set to [{}].",
|
||||||
|
@ -468,7 +468,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
||||||
} else if (parseFieldMatcher.match(currentName, NESTED_PATH_FIELD)) {
|
} else if (parseFieldMatcher.match(currentName, NESTED_PATH_FIELD)) {
|
||||||
nestedPath = parser.text();
|
nestedPath = parser.text();
|
||||||
} else if (token == Token.VALUE_STRING){
|
} else if (token == Token.VALUE_STRING){
|
||||||
if (fieldName != null) {
|
if (fieldName != null && fieldName.equals(currentName) == false) {
|
||||||
throw new ParsingException(
|
throw new ParsingException(
|
||||||
parser.getTokenLocation(),
|
parser.getTokenLocation(),
|
||||||
"Trying to reset fieldName to [{}], already set to [{}].",
|
"Trying to reset fieldName to [{}], already set to [{}].",
|
||||||
|
|
Loading…
Reference in New Issue