Annotation Interface Facet


Marker annotation on fields and methods that indicates that a property is to be used as facet when indexing a document for search.

Facets can be used to easily categorize documents and quickly get statistics about a set of matching documents. This is particularly useful when a collection contains many documents and statistics about those documents are required frequently.

The facet value is determined as follows:

1) in case the object is null or a blank string the facet is ignored;

2) in case the object is a collection, facets are created for each of the collection elements;

3) in case the object is a map, facets are created for each of the map values. Keys of the map are appended to the facet name (including a delimiting slash);

4) in case the class of the element is annotated with Facet, the toString() value of the element is used;

5) in case the object is a constant value (number, string or boolean), the toString() value of the element is used;

6) for other values, nested facets are collected by inspecting all annotated properties of the object. If the object contains any facets these will be included as well. Names of nested facets will be appended to the parent facet name (including a delimiting slash);

7) in other cases the toString() value of the element is used.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional argument that defines the name of the facet.
  • Element Details

    • value

      String value
      Optional argument that defines the name of the facet. If left empty, the property name will be used.
      Default:
      ""