Skip to content

TextIndex cannot be created when @Document contains collation specified [DATAMONGO-2316] #3173

Closed
@spring-projects-issues

Description

@spring-projects-issues

dmarko484 opened DATAMONGO-2316 and commented

When POJO is annotated with @Document + collation specified (e.g. below) now when there is a field annotated as 8@TextIndexed this index is not created during application start with error as below. Seems that index is being created with collation info but this option is not available for TextIndex, so it fails.

@Document(collection = "custPerson", language = "en", collation = "cs")
public class Person {
  @TextIndexed String firstname;
}

Error we are getting in this situation:

Nested exception is com.mongodb.MongoCommandException: Command failed with error 67 (CannotCreateIndex): 'Index type 'text' does not support collation: \{ locale: "cs", caseLevel: false, caseFirst: "off", strength: 3, numericOrdering: false, alternate: "non-ignorable", maxVariable: "punct", normalization: false, backwards: false, version: "57.1" }'

 

 


Affects: 2.2 RC1 (Moore)

Reference URL: https://docs.mongodb.com/manual/core/index-text/#collation-option

Metadata

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions