public Query toQuery(QueryParseContext context) {
BytesRef valueBytes = null;
String fieldName = this.fieldName;
FieldMapper mapper = context.fieldMapper(fieldName);
if (mapper != null) {
<BUG>fieldName = mapper.names().indexName();
</BUG>
valueBytes = mapper.indexedValueForSearch(value);
}
if (valueBytes == null) {

public Query toQuery(QueryParseContext context) {
BytesRef valueBytes = null;
String fieldName = this.fieldName;
FieldMapper mapper = context.fieldMapper(fieldName);
if (mapper != null) {
fieldName = mapper.fieldType().names().indexName();
valueBytes = mapper.indexedValueForSearch(value);
}
if (valueBytes == null) {
