Skip to content

Commit

Permalink
HSEARCH-2547 Consider nested @IndexedEmbeddeds as included even when …
Browse files Browse the repository at this point in the history
…upper-level @IndexedEmbedded with empty includePaths exist
  • Loading branch information
yrodiere authored and Sanne committed Jan 17, 2017
1 parent 1c88512 commit f448ca7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void checkDocumentId(XProperty member,
);
}
else {
if ( parseContext.includeEmbeddedObjectId() || pathsContext.isIncluded( fieldPath ) ) {
if ( parseContext.includeEmbeddedObjectId() || pathsContext != null && pathsContext.isIncluded( fieldPath ) ) {
createPropertyMetadataForEmbeddedId( member, typeMetadataBuilder, propertyMetadataBuilder,
numericFields, configContext, parseContext, fieldPath );
}
Expand Down Expand Up @@ -1917,8 +1917,14 @@ private boolean isInPath(String localPrefix, PathsContext pathsContext, IndexedE

private PathsContext updatePaths(String localPrefix, PathsContext pathsContext, IndexedEmbedded indexedEmbeddedAnnotation) {
if ( pathsContext != null ) {
// There is an upper-level path restriction: let it override any nested restriction
return pathsContext;
}
else if ( indexedEmbeddedAnnotation.includePaths().length == 0 ) {
// No upper-level restriction and no restriction on this level, either
return null;
}

PathsContext newPathsContext = new PathsContext();
for ( String path : indexedEmbeddedAnnotation.includePaths() ) {
newPathsContext.addIncludedPath( localPrefix + path );
Expand Down

0 comments on commit f448ca7

Please sign in to comment.