Fix lucene not allowed characters

This commit is contained in:
Peter Clement 2021-08-26 11:39:42 +01:00
parent 4cfcae415e
commit f7ebf7f8a4
3 changed files with 3 additions and 7 deletions

View File

@ -34,11 +34,7 @@
{:else if type === "boolean"} {:else if type === "boolean"}
<Toggle text={label} bind:value data-cy="{meta.name}-input" /> <Toggle text={label} bind:value data-cy="{meta.name}-input" />
{:else if type === "array"} {:else if type === "array"}
<Multiselect <Multiselect bind:value {label} options={meta.constraints.inclusion.flat()} />
bind:value
{label}
options={meta.constraints.inclusion.reduce((p, n) => p.concat(n), [])}
/>
{:else if type === "link"} {:else if type === "link"}
<LinkedRowSelector bind:linkedRows={value} schema={meta} /> <LinkedRowSelector bind:linkedRows={value} schema={meta} />
{:else if type === "longform"} {:else if type === "longform"}

View File

@ -62,7 +62,7 @@
} }
// if changed to an array, change default value to empty array // if changed to an array, change default value to empty array
const idx = filters.findIndex(x => (x.field = field)) const idx = filters.findIndex(x => x.field === field)
if (expression.type === "array") { if (expression.type === "array") {
filters[idx].value = [] filters[idx].value = []
} else { } else {

View File

@ -133,7 +133,7 @@ class QueryBuilder {
} }
// Escape characters // Escape characters
if (escape && originalType === "string") { if (escape && originalType === "string") {
value = `${value}`.replace(/[ #+\-&|!{}\]^"~*?:\\]/g, "\\$&") value = `${value}`.replace(/[ #+\-&|!(){}\]^"~*?:\\]/g, "\\$&")
} }
// Wrap in quotes // Wrap in quotes
if (hasVersion && wrap) { if (hasVersion && wrap) {