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

@IndexedEmbedded.includePaths should not allow to pick paths that were excluded from the embedded entity

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6.0.CR1
    • Fix Version/s: 6.0.0.Alpha1
    • Component/s: mapper-pojo
    • Labels:
      None

      Description

      *WARNING*: There are use cases for this, so we might consider not removing the feature after all, but simply ensuring it works correctly. See HSEARCH-1112 Open . => It is already done in 6 and throroughly tested. Let’s push some comments to these tests to link to this ticket, close this ticket, and reconsider when we have a look at HSEARCH-1112 Open .

      Follow-up on HSEARCH-2547 Closed .

      We don't prevent upper-level restrictions to be broader than nested restrictions. For instance:

      
      	@Entity
      	@Indexed
      	private static class A {
      		@Id
      		@GeneratedValue
      		private Long id;
      
      		@Field(analyze = Analyze.NO)
      		private String foo;
      
      		@Field(analyze = Analyze.NO)
      		private String bar;
      	}
      
      	@Entity
      	@Indexed
      	private static class B {
      		@Id
      		@GeneratedValue
      		private Long id;
      
      		@OneToOne
      		@IndexedEmbedded(includePaths = "foo") // Include only "a.foo"
      		private A a;
      	}
      
      	@Entity
      	@Indexed
      	private static class C {
      		@Id
      		@GeneratedValue
      		private Long id;
      
      		@OneToOne
      		@IndexedEmbedded(includePaths = { "a.foo", "a.bar" }) // Try to include "b.a.bar": this should not work, since "a.bar" is not included in b
      		private B b;
      	}
      

      This will include b.a.bar in the resulting document for C, even though a.bar is not part of the document for B.

        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: