001package com.avaje.ebean.annotation;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Used to indicate that a particular string property should support sorting. What this typically means is that
010 * for ElasticSearch an additional 'raw' field is added that stores the un-analysed value. This un-analysed value
011 * can be used for sorting etc and the original field used for text searching.
012 * <p>
013 * For example, customer name and product name are good candidates for marking with @DocSortable.
014 * </p>
015 */
016@Target({ ElementType.FIELD })
017@Retention(RetentionPolicy.RUNTIME)
018public @interface DocSortable {
019
020  /**
021   * Set to true to have the property additionally stored separately from _source.
022   */
023  boolean store() default false;
024
025  /**
026   * Set a boost value specific to this property.
027   */
028  float boost() default 1;
029
030  /**
031   * Set a value to use instead of null.
032   */
033  String nullValue() default "";
034}