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

Boolean is always OR, even if AND is configured #88

Open
tarekeldeeb opened this issue Aug 30, 2018 · 2 comments
Open

Boolean is always OR, even if AND is configured #88

tarekeldeeb opened this issue Aug 30, 2018 · 2 comments

Comments

@tarekeldeeb
Copy link

Starting with the example at http://elasticlunr.com/example/index.html
Configuring the boolean mode to AND has no effect, the same OR logic is still applied.

Test:
[1] Use the config file

{
    "fields": {
        "title": {"boost": 2},
        "body": {"boost": 1}
    },
    "boolean": "AND"
}

[2] Add the query word "checkbox" in the search input field. Only 4 results are listed.
[3] Now add the word "return" in the search input field.
-- Expected: Fewer results
-- Actual: Much more results!

@isac
Copy link

isac commented Oct 3, 2018

I picked this lib up today and ran into the same problem with the example page.

The problem seems to only exist on that page (running version 0.9.5 like I do on my computer). Running on my own generated index, boolean mode works. I'm guessing that the example page does not use the configuration at all.

Also note that the config name must be "bool" and not "boolean" as per elasticlunr.js/lib/configuration.js
.

@JamesTheBald
Copy link

JamesTheBald commented Apr 15, 2021

I ran into this as well - 2.5 years later on (which makes sense; the last publish was 5 years ago).
I just can't tell if it's a problem with the boolean logic or with how the search configuration in that example is implemented.

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