Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.9, 1.1.3
    • lucene
    • None

    Description

      Oak Lucene supports includePropertyTypes property which determines which all property types should be indexed. Its an array property whose would would be the names as defined in javax.jcr.PropertyType

      Current indexing logic has some inconsistent behaviour for default case when no explicit value is specified for this property. The propertyType restriction should support following cases

      1. If no explicit propertyType is defined then all types should be included
      2. It should be possible to define property type at property definition level also so as to distinguish properties based on type which share same name

      Details
      On indexing side LuceneIndexEditor has following logic to determine if a property is to be included or not

       if(context.isFullTextEnabled()
                              && (context.getPropertyTypes() & (1 << property.getType()
                              .tag())) == 0){
                          continue;
                      }
      

      The default value for propertyTypes is -1 as per [2]

       PropertyState pst = defn.getProperty(INCLUDE_PROPERTY_TYPES);
              if (pst != null) {
                  int types = 0;
                  for (String inc : pst.getValue(Type.STRINGS)) {
                      try {
                          types |= 1 << PropertyType.valueFromName(inc);
                      } catch (IllegalArgumentException e) {
                          log.warn("Unknown property type: " + inc);
                      }
                  }
                  this.propertyTypes = types;
              } else {
                  this.propertyTypes = -1;
              }
      

      Due to this in default case all properties would be indexed if no explicit value is set

      However on query side the inclusion rule uses following logic. Due to which per default config a value of -1 indicates that none of properties would be considered to be included

          boolean includePropertyType(int type){
              if(propertyTypes < 0){
                  return false;
              }
              return (propertyTypes & (1 << type)) != 0;
          }
      

      [2] https://svn.apache.org/repos/asf/jackrabbit/oak/tags/jackrabbit-oak-1.0.8/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexDefinition.java

      Attachments

        Activity

          People

            chetanm Chetan Mehrotra
            chetanm Chetan Mehrotra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: