'Duplicate index field definition:

How to handle this scenario? Here is the property defined in my entity class

@Column(nullable = false)
@NotNull
@ApiModelProperty(required = true)
@Size(min = 3, max = 255)
@GenericField(sortable = Sortable.YES)
@FullTextField(analyzer = "lowercaseWhitespaceAnalyzer")
private String title;

Exception:

HSEARCH400520: Duplicate index field definition: 'title'. Index field names must be unique. Look for two property mappings with the same field name, or two indexed-embeddeds with prefixes that lead to conflicting index field names, or two custom bridges declaring index fields with the same name.

Do I need to create two separate fields as shown in the documentation like:

@FullTextField
@KeywordField(name = "title_sort", normalizer = "myNormalizer", sortable = Sortable.YES)
private String title;

If I tried this getting below exception:

Invalid value. Expected 'lowercaseWhitespaceAnalyzer', actual is 'null' field 'context': attribute 'type': failures: - Invalid value. Expected 'text', actual is 'keyword' attribute 'analyzer': failures: - Invalid value. Expected 'lowercaseWhitespaceAnalyzer', actual is 'null' field 'context_sort': failures: - Missing property mapping



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source