-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add numeric_type sorting option. (#3998)
For numeric fields it is also possible to cast the values from one type to another using this option. This can be useful for cross-index search if the sort field is mapped differently on some indices. (cherry picked from commit 98a9427)
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Runtime.Serialization; | ||
using Elasticsearch.Net; | ||
|
||
namespace Nest | ||
{ | ||
/// <summary> | ||
/// For numeric fields it is also possible to cast the values from one type to another using this option. This can be useful for cross-index | ||
/// search if the sort field is mapped differently on some indices. | ||
/// </summary> | ||
[StringEnum] | ||
public enum NumericType | ||
{ | ||
[EnumMember(Value = "long")] | ||
Long, | ||
|
||
[EnumMember(Value = "double")] | ||
Double, | ||
|
||
[EnumMember(Value = "date")] | ||
Date, | ||
|
||
[EnumMember(Value = "date_nanos")] | ||
DateNanos | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters