Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12279

Default value of @IndexedEmbedded.depth is not correctly interpreted

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 12.0.0.Final
    • 12.0.0.Final
    • Embedded Querying
    • None

      There was a problem during the migration to Search 6, and the processor for the annotation @IndexedEmbedded apparently does not correctly intepret @IndexedEmbedded() as "no depth defined".

      As a result, {{@IndexedEmbedded(includePaths =

      { "foo" }

      )}} will not set the depth to 0 as it should, but to Integer.MAX_VALUE (the default defined on the @IndexedEmbedded.depth() attribute) and will end up incorrectly including the whole embedded document.

      The code to change is this (in org.hibernate.search.annotations.IndexedEmbedded):

               Integer cleanedUpMaxDepth = annotation.depth();
               if ( cleanedUpMaxDepth.equals( -1 ) ) {
                  cleanedUpMaxDepth = null;
               }
      

      It should be instead:

               Integer cleanedUpMaxDepth = annotation.depth();
               if ( cleanedUpMaxDepth.equals( Integer.MAX_VALUE ) ) {
                  cleanedUpMaxDepth = null;
               }
      

              rh-ee-yrodiere Yoann Rodière
              rh-ee-yrodiere Yoann Rodière
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: