Skip to content
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

Static keys for facet options (GSI-333) #14

Merged
merged 6 commits into from
Aug 31, 2023

Conversation

TheByronHimes
Copy link
Member

Previously, facets returned by queries took the format:

"facets": [
      {
        "key": "alias",
        "name": "Alias",
        "options": {
          "DS_3": 1,
          ...
        }
      }
    ]

but to aid frontend's usage of the data, it will be restructured with this PR to look like this:

"facets": [
      {
        "key": "alias",
        "name": "Alias",
        "options": [
          {"value": "DS_3", "count": 1},
          ...
        ]
      }
    ]

Replace the _id field from the groupby with value

Remove sort-by-count for options since it's not even used by frontend
This will handle cases where there's a document doesn't have all facets
Copy link

@ac-jorellanaf ac-jorellanaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Member

@mephenor mephenor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully get everything that's happening, but I think I understand enough to approve this

@TheByronHimes TheByronHimes merged commit 2e5f7e3 into main Aug 31, 2023
6 checks passed
@TheByronHimes TheByronHimes deleted the feature/facets_structure_GSI-333 branch August 31, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants