You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to figure out how to implement the NOT operator, using the same style of the others.
module.exports = (l, r) => (data) => {
let rl = l(data);
let rr = r(data);
let rla = Math.abs(rl);
let rra = Math.abs(rr);
return rla !== rra;
};
This is giving me promising results, eg
console.log(data.filter(lucene('species:human NOT description:master')));
[
{
name: 'Anakin Skywalker',
description: 'Fallen Jedi, the chosen one.',
species: 'Human'
}
]
But then flops with something like
console.log(data.filter(lucene('species:human NOT name:o')));
// should be
[
{
name: 'Anakin Skywalker',
description: 'Fallen Jedi, the chosen one.',
species: 'Human'
}
]
// actual result
[
{ name: 'C-3PO', description: 'Protocol droid.', species: 'Droid' },
{
name: 'Anakin Skywalker',
description: 'Fallen Jedi, the chosen one.',
species: 'Human'
},
{
name: 'Moon Moon',
description: 'Mentally challenged wolf.',
species: 'Wolf'
}
]
No idea how it's so broken, but like I mentioned in another issue, I don't really understand the logic used in the operators yet. This is just a first stab in the dark at the NOT operator.
The text was updated successfully, but these errors were encountered:
The original idea of the NOT operator was that it'd revert the result of the matcher, basically subtracting points from the end-result if the matcher reports it's matching.
There's a high chance I have not implemented that basic idea properly though
Trying to figure out how to implement the NOT operator, using the same style of the others.
This is giving me promising results, eg
But then flops with something like
No idea how it's so broken, but like I mentioned in another issue, I don't really understand the logic used in the operators yet. This is just a first stab in the dark at the NOT operator.
The text was updated successfully, but these errors were encountered: