-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for searching by group #243
Conversation
// } | ||
type parseResponse struct { | ||
Query string `json:"query"` | ||
Fields []string `json:"fields"` | ||
ElasticQuery interface{} `json:"elastic_query"` | ||
AllowAsGroup bool `json:"allow_as_group"` |
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.
seems like we shouldn't trust RP on this.. and maybe even push this decision down to goflow
@@ -28,11 +28,11 @@ | |||
"path": "/mr/contact/parse_query", | |||
"body": { | |||
"org_id": 1, | |||
"query": "age \u003e 10" | |||
"query": "AGE>10" |
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.
make sure we're sending back a rewritten query
ed1bcca
to
ae07523
Compare
Codecov Report
@@ Coverage Diff @@
## master #243 +/- ##
==========================================
- Coverage 48.08% 48.04% -0.05%
==========================================
Files 83 83
Lines 7603 7608 +5
==========================================
- Hits 3656 3655 -1
- Misses 3368 3371 +3
- Partials 579 582 +3
Continue to review full report at Codecov.
|
ae07523
to
676ac76
Compare
search/search.go
Outdated
@@ -14,6 +14,9 @@ import ( | |||
"github.com/shopspring/decimal" | |||
) | |||
|
|||
// GroupResolverFunc resolves a group name to a UUID because ES indexes groups by the latter | |||
type GroupResolverFunc func(name string) assets.Group |
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.
What about having a single interface that has a ResolveField
and ResolveGroup
function on it? Just seems we are building lots of anonymous functions to represent something instead of just having an interface that would be clearer.
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.
That's fine but note that you can't use an interface - golang doesn't let you implement an interface anonymously 😐
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.
Not sure I understand. Yes, we'd need to create a struct, but then OrgAssets could just satisfy that as would a test version.
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.
That's what I'm doing - just meant you need a struct.. can't just define the funcs on the fly like we're doing currently
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.
Oh, well I don't much love on the fly funcs anyways so that's fine by me!
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 think this should work! I would REALLY like to see an interface for resolving things instead of passing in two functions though.
@nicpottier wanna take another peek? |
Update to latest goflow
Pausing to go learn ES..