Mapping Properties Multiple Times
4.1.2. Mapping properties multiple times Sometimes one has to map a property multiple times per index, with slightly different indexing strategies. For example, sorting a query by field requires the field to be UN_TOKENIZED. If one wants to search by words in this property and still sort it, one need to index it twice - once tokenized and once untokenized. @Fields allows to achieve this goal. Example 4.3. Using @Fields to map a property multiple times @Entity @Indexed(index = "Book" ) public class Book { @Fields( { @Field(index = Index.TOKENIZED), @Field(name = "summary_forSort", index = Index.UN_TOKENIZED, store = Store.YES) } ) public String getSummary() { return summary; } ... } In Example 4.3, “Using @Fields to map a property multiple times” the field summary is indexed twice, once as summary in a tokenized way, and once as summary_forSort in an untokenized way. @Field supports 2 attributes useful when @Fields is used: analyzer: defines a @Analyzer annotation per field rather than per property bridge: defines a @FieldBridge annotation per field rather than per property See below for more information about analyzers and field bridges.