-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix facet support #100
fix facet support #100
Conversation
This makes it easier to see what Super Search is returning in the response payload.
This changes the basic supersearchfacet mode to support multiple facets. So you can now do: supersearchfacet --_facets=product --_facets=platform \ --_facets=release_channel And it'll do one Super Search API query and print the information for each facet in a separate group. This also adds a "raw" format which prints the HTTP response without doing anything to it. This fixes support for cardinality. For example, this now works: supersearchfacet --product=Firefox --_facets=_cardinality.build_id
|
||
# If it is in count/period mode, then we have to do one facet for each | ||
# period and compose the results. | ||
if "signature" not in params["_facets"] and "signature" in facet_data_payload["facets"]: |
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.
We should fix this in Crash Stats, but I'm not sure why Crash Stats does this and what might rely on it because it's been this way for years.
|
||
# Figure out what facet we're doing | ||
facet_name = params["_facets"][0] | ||
if format_type == "raw": |
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.
Between this format and --verbose
, you get a great idea of what the HTTP request and response look like.
|
||
for day_start, day_end in generate_periods(period, start_date, end_date): |
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 can get rid of generate_periods, too.
Previously, we had our own implementation of histograms allowing us to look at values over time. This reworks supersearchfacet to use Super Search API _histogram and _histogram_interval to do the same thing, but with a single Super Search API call.
facets = facet_data["facets"] | ||
if format_type == "json": | ||
console.print_json(json.dumps(facet_tables)) | ||
continue |
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.
For JSON format, it's better to print the whole thing rather than break it up into fields, so we do that here. Further, we probably don't want the blank line between items.
:returns: a map of facet_name -> {headers: headers, records: records} | ||
|
||
""" | ||
# FIXME(willkg): add support for nested aggregations |
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.
Also need to add support for cardinality values.
_histogram
support (support _histogram in super search api #98)Fixes #99
Fixes #98