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

The "alwaysArray" option doesn't apply to "exclude" #27

Open
davidmz opened this issue Mar 11, 2019 · 4 comments
Open

The "alwaysArray" option doesn't apply to "exclude" #27

davidmz opened this issue Mar 11, 2019 · 4 comments

Comments

@davidmz
Copy link

davidmz commented Mar 11, 2019

See example at: https://runkit.com/davidmz/5c86c4ecc72b580012f955eb

I expect that it should be exclude: {in: ["space"]} but got exclude: {in: "space"}

@nepsilon
Copy link
Owner

Thanks for the report. Would you want to provide a PR handling this case?

@nepsilon
Copy link
Owner

Thanks @rschick 👍 Merged and published as v1.5.1.

@LordMike
Copy link

Hey - with 1.6.0, I'm seeing the following:

searchQueryParse('-banana', {tokenize: true, offsets: false})
{
    "exclude": {
        "text": "banana"
    }
}

searchQueryParse('-banana', {tokenize: true, offsets: false, alwaysArray: true})
{
    "exclude": {
        "text": "banana"
    }
}

But doing multiple values works:

searchQueryParse('-banana -baddie', {tokenize: true, offsets: false})
{
    "exclude": {
        "text": [
            "banana",
            "baddie"
        ]
    }
}

@nepsilon
Copy link
Owner

Thanks @LordMike , I confirm I see the same issue. I added 4 more tests in #50 , 2 of them are failing due to this bug.
I don't have time to work on this at the moment but will follow up on the PR if anyone can help out.

@nepsilon nepsilon reopened this Aug 27, 2021
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

3 participants