We were using hibernate search with lucene and on a single field we were able to put multiple mappings using
@Field(name = "username" @FieldBridge=CustomBridge.class),
@Field(name = "userid")
private Long userId;
So hibernate search creates 2 mappings for userId field, 1st is to index username and 2nd is to index userid. Inside the bridge we write code to fetch the user object from the userId and then return the username to be indexed.
Is the similar functionality available in Elastic Search?
I know that ES provides a multifield type but how to define the value converter is what I am looking for.