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
- If no explicit propertyType is defined then all types should be included
- 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; }