|
|
|
@ -85,6 +85,11 @@ export const luceneQuery = (docs, query) => { |
|
|
|
return !doc[key] || !doc[key].startsWith(value) |
|
|
|
}) |
|
|
|
|
|
|
|
// Process a fuzzy match (treat the same as starts with when running locally)
|
|
|
|
const fuzzyMatch = match("fuzzy", (key, value, doc) => { |
|
|
|
return !doc[key] || !doc[key].startsWith(value) |
|
|
|
}) |
|
|
|
|
|
|
|
// Process a range match
|
|
|
|
const rangeMatch = match("range", (key, value, doc) => { |
|
|
|
return !doc[key] || doc[key] < value.low || doc[key] > value.high |
|
|
|
@ -114,6 +119,7 @@ export const luceneQuery = (docs, query) => { |
|
|
|
const docMatch = doc => { |
|
|
|
return ( |
|
|
|
stringMatch(doc) && |
|
|
|
fuzzyMatch(doc) && |
|
|
|
rangeMatch(doc) && |
|
|
|
equalMatch(doc) && |
|
|
|
notEqualMatch(doc) && |
|
|
|
|