From ea0a17331d8d695095164d8a3e5dfcf70bc36a5b Mon Sep 17 00:00:00 2001 From: Francesco Marciani Date: Thu, 7 Mar 2024 10:56:58 +0100 Subject: [PATCH] disable indexing for `has` filter operator --- .../src/get/executeGetOperations/indexing.ts | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/client/src/get/executeGetOperations/indexing.ts b/client/src/get/executeGetOperations/indexing.ts index 8a6d93023..b209be5e7 100644 --- a/client/src/get/executeGetOperations/indexing.ts +++ b/client/src/get/executeGetOperations/indexing.ts @@ -35,30 +35,6 @@ function ast2inlineRpn(schema: Schema, f: FilterAST | null): string | null { const num = Number(f.$value) return Number.isNaN(num) ? null : `"${f.$field}" g #${num} F` } - case 'has': - if (['ancestors', 'children', 'descendants', 'parents'].includes(f.$field)) { - return null - } - - if (typeof f.$value === 'string') { - return `"${f.$value}" "${f.$field}" a` - } else if (typeof f.$value === 'number') { - return `#${f.$value} "${f.$field}" a` - } else if (Array.isArray(f.$value)) { - if (typeof f.$value[0] === 'string') { - if (f.$value.some((v: string) => v.includes('"'))) { - // We can't inline quotes at the moment - return null - } - - const a = `{${f.$value.map((v) => `"${v}"`).join(',')}}` - return `"${f.$field}" ${a} l` - } else if (typeof f.$value[0] === 'number') { - const a = `{${f.$value.map((v) => `#${v}`).join(',')}}` - return `"${f.$field}" ${a} l` - } - return null - } case 'exists': return `"${f.$field}" h` case 'notExists':