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

Queries with NOT in between throw error #46

Open
laggingreflex opened this issue Apr 30, 2020 · 1 comment
Open

Queries with NOT in between throw error #46

laggingreflex opened this issue Apr 30, 2020 · 1 comment
Assignees

Comments

@laggingreflex
Copy link
Contributor

const data = [
{ name: 'C-3PO'           , description: 'Protocol droid.'                , species: 'Droid' },
{ name: 'R2-D2'           , description: 'Astromech droid built on Naboo.', species: 'Droid' },
{ name: 'Anakin Skywalker', description: 'Fallen Jedi, the chosen one.'   , species: 'Human' },
{ name: 'Obi-Wan Kenobi'  , description: 'Jedi Master.'                   , species: 'Human' },
{ name: 'Moon Moon'       , description: 'Mentally challenged wolf.'      , species: 'Wolf'  },
];

console.log(data.filter(lucene('an NOT anakin')));

Expected: "Obi-Wan Kenobi"

Current result: Throws an error:

C:\…\lucene-filter\src\index.js:28
      return lucene.operators[query.operator](
                                             ^

TypeError: lucene.operators[query.operator] is not a function
    at compile (C:\…\lucene-filter\src\index.js:28:46)
    at Object.<anonymous> (C:\…\index.js:52:25)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
@finwo
Copy link
Owner

finwo commented May 2, 2020

Looks like I've never created the NOT operator. I'll have to look into the lucene specification on what this will have to do.

@finwo finwo self-assigned this Aug 4, 2020
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