Buggy code:
public static final String BOTTOMRIGHT = "bottomRight" ; public static final String FIELD = "field" ; @ Inject public GeoBoundingBoxQueryParser ( ) { } @ Override public String [ ] names ( ) { } @ Override public Query parse ( QueryParseContext parseContext ) throws IOException , QueryParsingException { XContentParser parser = parseContext . parser ( ) ; String fieldName = null ; double top = Double . NaN ; double bottom = Double . NaN ; double left = Double . NaN ; double right = Double . NaN ; String queryName = null ; String currentFieldName = null ; XContentParser . Token token ; boolean normalize = true ; GeoPoint sparse = new GeoPoint ( ) ; String type = "memory" ; while ( ( token = parser . nextToken ( ) ) != ( Token . END_OBJECT ) ) { if ( token == ( Token . FIELD_NAME ) ) { currentFieldName = parser . currentName ( ) ; } else if ( token == ( Token . START_OBJECT ) ) { fieldName = currentFieldName ; while ( ( token = parser . nextToken ( ) ) != ( Token . END_OBJECT ) ) { if ( token == ( Token . FIELD_NAME ) ) { currentFieldName = parser . currentName ( ) ; token = parser . nextToken ( ) ; if ( parseContext . isDeprecatedSetting ( currentFieldName ) ) { } else if ( GeoBoundingBoxQueryParser . FIELD . equals ( currentFieldName ) ) { fieldName = parser . text ( ) ; } else if ( GeoBoundingBoxQueryParser . TOP . equals ( currentFieldName ) ) { top = parser . doubleValue ( ) ; } else if ( GeoBoundingBoxQueryParser . BOTTOM . equals ( currentFieldName ) ) { bottom = parser . doubleValue ( ) ; } else if ( GeoBoundingBoxQueryParser . LEFT . equals ( currentFieldName ) ) { left = parser . doubleValue ( ) ; } else if ( GeoBoundingBoxQueryParser . RIGHT . equals ( currentFieldName ) ) { right = parser . doubleValue ( ) ; } else { if ( ( GeoBoundingBoxQueryParser . TOP_LEFT . equals ( currentFieldName ) ) || ( GeoBoundingBoxQueryParser . TOPLEFT . equals ( currentFieldName ) ) ) { GeoUtils . parseGeoPoint ( parser , sparse ) ; top = sparse . getLat ( ) ; left = sparse . getLon ( ) ; } else if ( ( GeoBoundingBoxQueryParser . BOTTOM_RIGHT . equals ( currentFieldName ) ) || ( GeoBoundingBoxQueryParser . BOTTOMRIGHT . equals ( currentFieldName ) ) ) { GeoUtils . parseGeoPoint ( parser , sparse ) ; bottom = sparse . getLat ( ) ; right = sparse . getLon ( ) ; } else if ( ( GeoBoundingBoxQueryParser . TOP_RIGHT . equals ( currentFieldName ) ) || ( GeoBoundingBoxQueryParser . TOPRIGHT . equals ( currentFieldName ) ) ) { GeoUtils . parseGeoPoint ( parser , sparse ) ; top = sparse . getLat ( ) ; right = sparse . getLon ( ) ; } else if ( ( GeoBoundingBoxQueryParser . BOTTOM_LEFT . equals ( currentFieldName ) ) || ( GeoBoundingBoxQueryParser . BOTTOMLEFT . equals ( currentFieldName ) ) ) { GeoUtils . parseGeoPoint ( parser , sparse ) ; bottom = sparse . getLat ( ) ; left = sparse . getLon ( ) ; } else { throw new ElasticsearchParseException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>unexpected<seq2seq4repair_space>field<seq2seq4repair_space>[{}]" , GeoBoundingBoxQueryParser . NAME , currentFieldName ) ; } } } else { throw new ElasticsearchParseException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>field<seq2seq4repair_space>name<seq2seq4repair_space>expected<seq2seq4repair_space>but<seq2seq4repair_space>[{}]<seq2seq4repair_space>found" , GeoBoundingBoxQueryParser . NAME , token ) ; } } } else if ( token . isValue ( ) ) { if ( "_name" . equals ( currentFieldName ) ) { queryName = parser . text ( ) ; } else if ( "normalize" . equals ( currentFieldName ) ) { normalize = parser . booleanValue ( ) ; } else if ( "type" . equals ( currentFieldName ) ) { type = parser . text ( ) ; } else { throw new QueryParsingException ( parseContext , "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>unexpected<seq2seq4repair_space>field<seq2seq4repair_space>[{}]" , GeoBoundingBoxQueryParser . NAME , currentFieldName ) ; } } } final GeoPoint topLeft = sparse . reset ( top , left ) ; final GeoPoint bottomRight = new GeoPoint ( bottom , right ) ; if ( normalize ) { boolean completeLonRange = ( ( ( right - left ) % 360 ) == 0 ) && ( right > left ) ; GeoUtils . normalizePoint ( topLeft , true , ( ! completeLonRange ) ) ; GeoUtils . normalizePoint ( bottomRight , true , ( ! completeLonRange ) ) ; if ( completeLonRange ) { topLeft . resetLon ( ( - 180 ) ) ; bottomRight . resetLon ( 180 ) ; } } MappedFieldType fieldType = parseContext . fieldMapper ( fieldName ) ; if ( fieldType == null ) { throw new QueryParsingException ( parseContext , "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>[{}]<seq2seq4repair_space>field<seq2seq4repair_space>[{}]" , GeoBoundingBoxQueryParser . NAME , GeoPointFieldMapper . CONTENT_TYPE , fieldName ) ; } if ( ! ( fieldType instanceof GeoPointFieldMapper . GeoPointFieldType ) ) { <START_BUG> throw new QueryParsingException ( parseContext , "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>field<seq2seq4repair_space>[{}]<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[{}],<seq2seq4repair_space>but<seq2seq4repair_space>is<seq2seq4repair_space>of<seq2seq4repair_space>[{}]<seq2seq4repair_space>type<seq2seq4repair_space>instead" , GeoBoundingBoxQueryParser . NAME , fieldName , GeoPointFieldMapper . CONTENT_TYPE , fieldType . names ( ) . shortName ( ) ) ; <END_BUG> } GeoPointFieldMapper . GeoPointFieldType geoFieldType = ( ( GeoPointFieldMapper . GeoPointFieldType ) ( fieldType ) ) ; Query filter ; if ( "indexed" . equals ( type ) ) { filter = IndexedGeoBoundingBoxQuery . create ( topLeft , bottomRight , geoFieldType ) ; } else if ( "memory" . equals ( type ) ) { IndexGeoPointFieldData indexFieldData = parseContext . getForField ( fieldType ) ; filter = new org . elasticsearch . index . search . geo . InMemoryGeoBoundingBoxQuery ( topLeft , bottomRight , indexFieldData ) ; } else { throw new QueryParsingException ( parseContext , "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>geo<seq2seq4repair_space>bounding<seq2seq4repair_space>box<seq2seq4repair_space>type<seq2seq4repair_space>[{}]<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>supported.<seq2seq4repair_space>either<seq2seq4repair_space>[indexed]<seq2seq4repair_space>or<seq2seq4repair_space>[memory]<seq2seq4repair_space>are<seq2seq4repair_space>allowed" , GeoBoundingBoxQueryParser . NAME , type ) ; } if ( queryName != null ) { parseContext . addNamedQuery ( queryName , filter ) ; } return filter ; } }

Fix:
throw new QueryParsingException ( parseContext , "failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>[{}]<seq2seq4repair_space>query.<seq2seq4repair_space>field<seq2seq4repair_space>[{}]<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>[{}],<seq2seq4repair_space>but<seq2seq4repair_space>is<seq2seq4repair_space>of<seq2seq4repair_space>[{}]<seq2seq4repair_space>type<seq2seq4repair_space>instead" , GeoBoundingBoxQueryParser . NAME , fieldName , GeoPointFieldMapper . CONTENT_TYPE , fieldType . typeName ( ) ) ;