spring-projects / spring-projects/spring-data-mongodb
Improve text index creation when dealing with nested entities/documents [DATAMONGO-1561]
@christophstrobl is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
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:
-
BasicMongoPersistentEntitywill verify that entities marked with@ContainsTextIndexedFieldseffectively have at least one field marked with@TextIndexedotherwise aMappingExceptionwill be thrown -
MongoPersistentEntityIndexResolver.appendTextIndexInformationwill 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 https://github.com/spring-projects/spring-data-mongodb/pull/442
1 votes, 1 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.