Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2839

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.8.0.CR1
    • Component/s: elasticsearch, query
    • Labels:
      None

      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:

      			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
      						);
      			}
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                yrodiere Yoann Rodière
                Reporter:
                yrodiere Yoann Rodière
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: