-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,22 +25,25 @@ public Field(string key, object value, bool store = true, bool analyze = true, b | |
Analyze = analyze; | ||
Index = index; | ||
|
||
object obj = value; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kreeben
Author
Owner
|
||
|
||
if (value is DateTime) | ||
{ | ||
_value = ((DateTime)value).Ticks.ToString(); | ||
obj = ((DateTime)value).ToUniversalTime().Ticks.ToString(); | ||
} | ||
else if (value is string) | ||
|
||
if (obj is string) | ||
{ | ||
_value = value.ToString(); | ||
_value = obj.ToString(); | ||
} | ||
else | ||
{ | ||
// Assumes all values that are not DateTime or string must be Int32. | ||
// Assumes all values that are not DateTime or string must be Int64. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kreeben
Author
Owner
|
||
|
||
// TODO: implement native number indexes | ||
|
||
var len = int.MaxValue.ToString().Length; | ||
_value = value.ToString().PadLeft(len, '0'); | ||
var len = long.MaxValue.ToString().Length; | ||
_value = obj.ToString().PadLeft(len, '0'); | ||
} | ||
} | ||
} | ||
|
What about nullable types?
DateTime? , long?