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

Collection is "" if it's not set #168

Open
leapoly opened this issue Jun 18, 2024 · 1 comment
Open

Collection is "" if it's not set #168

leapoly opened this issue Jun 18, 2024 · 1 comment

Comments

@leapoly
Copy link

leapoly commented Jun 18, 2024

Description

If the collection is not set in the multiSerachCollectionParameters, the client will send an empty string, which is not valid.

Steps to reproduce

image

The body of the request will be:

{
    "searches": [
        {
            "collection": "",
            "filter_by": "(active:true \\u0026\\u0026 closed:false) || (active:true \\u0026\\u0026 closed:true)",
            "include_fields": "id",
            "preset": "Events",
            "q": "trump"
        },
        {
            "collection": "",
            "include_fields": "id",
            "preset": "Tags",
            "q": "trump"
        },
        {
            "collection": "",
            "include_fields": "id",
            "preset": "Profiles",
            "q": "trump"
        }
    ]
}

Expected Behavior

It shouldn't be sent because I'm using a Preset that has a collection.

Actual Behavior

It makes the search in the collection "" that does not exist.

Metadata

Typesense Version: 1.1.0

OS: Mac

@kishorenc
Copy link
Member

The collection name field is a string and not a pointer, like other fields, so it's sent as empty string when not set. We will have to probably handle this in Typesense end because changing the collection type to pointer.String will break existing client conventions. I will take a look and post an update here.

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