-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object: Support numerical search queries #285
Conversation
63b99c2
to
3aa02e1
Compare
NUM_LT = 7; | ||
|
||
// Numerical 'less or equal than' | ||
NUM_LE = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NUM_EQUAL
?
the previously added STRING_EQUAL / STRING_NOT_EQUAL matchers are suitable for numerical == / !=.
While it is true for now, it looks strange to me. Users should use STRING_EQUAL
for numbers in their interfaces. Also, it is possible not to have strings-only values in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new values will be added when the existing ones are no longer sufficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this question as well, but as we're not supporting different notations ("1e8", for example) now, current set is sufficient for the purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my main point, i would say, in the naming of this message: MatchType
(it is not bound to Filter
), no info about what it relates to. i can imagine reusing this for a number representation of smth, then we will have to add NUM_EQUAL
but we will already have had some users that will be using STRING_EQUAL
, strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this enum is not intended to be reused. Imaginary importer will have to use it as it is, or will define it's own enum. Anyway, these are just numbers. Protocol inflation for the indefinite future is bad thing to do imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this enum is not intended to be reused
but there are no words about what it is used for
37645b7
3aa02e1
to
37645b7
Compare
rebased and CHANGELOGed |
Previously, protocol did not support numerical search queries for objects. This may be needed for system attributes such as payload size or creation epoch, and for user ones if required by the client application. New values of `MatchType` enumeration are added: `>`, `>=`, `<`, `<=`. These attributes allow user to search for objects with any decimal attributes. While only base-10 numbers are allowed, additional bases may be supported in the future without new enumerations Note that the previously added `STRING_EQUAL` / `STRING_NOT_EQUAL` matchers are suitable for numerical `==` / `!=`. Closes #265. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
37645b7
to
0588aca
Compare
Previously, protocol did not support numerical search queries for objects. This may be needed for system attributes such as payload size or creation epoch, and for user ones if required by the client application.
New values of
MatchType
enumeration are added:>
,>=
,<
,<=
. These attributes allow user to search for objects with any decimal attributes. While only base-10 numbers are allowed, additional bases may be supported in the future without new enumerationsNote that the previously added
STRING_EQUAL
/STRING_NOT_EQUAL
matchers are suitable for numerical==
/!=
.Closes #265.