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

Unable to use facetBy #28

Open
giilby opened this issue Nov 7, 2023 · 1 comment
Open

Unable to use facetBy #28

giilby opened this issue Nov 7, 2023 · 1 comment

Comments

@giilby
Copy link

giilby commented Nov 7, 2023

Description

When facetBy is specified, results cannot be decoded. I believe this is because SearchResult.facetCounts is defined as [Int]?, but the actual value of that field is an array of documents that look like this:

facet_counts": [
        {
            "counts": [
                {
                    "count": 4,
                    "highlighted": "Value A",
                    "value": "Value A"
                },
                ...
                {
                    "count": 1,
                    "highlighted": "Value B",
                    "value": "Value B"
                }
            ],
            "field_name": "some_field",
            "stats": {
                "total_values": 7
            }
        }
]

Steps to reproduce

Execute a search with one or more fields specified in facetBy.

Expected Behavior

A usable SearchResult object is returned.

Actual Behavior

A decoding exception is thrown.

Metadata

Typesense Version: 0.24.1

OS: iOS 17.0.3

@luciana-ezcurra
Copy link

same issue, could you find any solution?

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

No branches or pull requests

2 participants