Skip to content

Improve text index creation when dealing with nested entities/documents [DATAMONGO-1561] #2477

Open
@spring-projects-issues

Description

@spring-projects-issues

Jordi Llach Fernandez opened DATAMONGO-1561 and commented

Given an entity A that contains a @TextIndexed field whom in turn is another entity(B). MongoPersistentEntityIndexResolver's method appendTextIndexInformation changes the IncludeStrategy from DEFAULT to FORCE and thus cause that ALL the fields of the nested document B to become part of the text index, no matter if this nested document contains a set of selected fields marked as @TextIndexed or not.

I was expecting that only selected fields of entity B will become part of the text index.

I could make a PR that will enable this behaviour with two steps:

  • BasicMongoPersistentEntity will verify that entities marked with @ContainsTextIndexedFields effectively have at least one field marked with @TextIndexed otherwise a MappingException will be thrown

  • MongoPersistentEntityIndexResolver.appendTextIndexInformation will not change the include strategy for a nested entity when this is marked with @ContainsTextIndexedFields

What do you think ? makes sense ?


Reference URL: https://jira.spring.io/browse/DATAMONGO-937

Referenced from: pull request #442

1 votes, 1 watchers

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions