Class SortableEntry
java.lang.Object
io.fluxcapacitor.common.api.search.SortableEntry
- All Implemented Interfaces:
Comparable<SortableEntry>
Represents a sortable entry in a
Document
for use in search
operations.
SortableEntry
values are primarily used to support efficient sorting and range filtering in the document store
(e.g., numeric or timestamp-based queries). Each entry consists of a name (field path) and a pre-normalized,
lexicographically sortable value as a String
.
Values are formatted using a normalization strategy depending on their type:
- Numbers: Encoded into padded, base-10 fixed-width strings for fast and correct range comparisons
- Timestamps: Formatted using
SearchUtils.ISO_FULL
- Other values: Normalized to lowercase using
SearchUtils.normalize(String)
Example Use Cases
- Sorting search results by timestamp or numeric score
- Enabling fast
BetweenConstraint
evaluation - Filtering or grouping based on normalized values
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<SortableEntry> Comparator used to lexicographically compare entries based onname
andvalue
. -
Constructor Summary
ConstructorsConstructorDescriptionSortableEntry
(String name, Object value) Constructs a newSortableEntry
by formatting the given object into a normalized, sortable string. -
Method Summary
Modifier and TypeMethodDescriptionint
static String
formatSortable
(Object value) Formats the given object into a sortable string depending on its type.static String
toSortableString
(Number number) Converts aNumber
to a lexicographically sortable zero-padded string.
-
Field Details
-
comparator
Comparator used to lexicographically compare entries based onname
andvalue
.
-
-
Constructor Details
-
Method Details
-
formatSortable
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SortableEntry>
-
toSortableString
Converts aNumber
to a lexicographically sortable zero-padded string.
-