We're updating the issue view to help you get more done. 

Projecting on a default field whose type was overridden in the bridge fails with Elasticsearch

Description

This is caused by the fact we systematically add a projection for the default field with its default type, whether or not there's a bridge-defined field overriding it:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 else if ( fieldBridge instanceof TwoWayFieldBridge ) { sourceFilterCollector.add( new JsonPrimitive( absoluteName ) ); PrimitiveProjection defaultFieldProjection = new PrimitiveProjection( rootTypeMetadata, absoluteName, type ); Collection<BridgeDefinedField> bridgeDefinedFields = fieldMetadata.getBridgeDefinedFields().values(); List<PrimitiveProjection> bridgeDefinedFieldsProjections = CollectionHelper.newArrayList( bridgeDefinedFields.size() ); for ( BridgeDefinedField bridgeDefinedField : bridgeDefinedFields ) { PrimitiveProjection primitiveProjection = createProjection( sourceFilterCollector, rootTypeMetadata, bridgeDefinedField ); bridgeDefinedFieldsProjections.add( primitiveProjection ); } return new TwoWayFieldBridgeProjection( absoluteName, (TwoWayFieldBridge) fieldBridge, defaultFieldProjection, bridgeDefinedFieldsProjections ); }

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Components

Fix versions

Priority

Major