Skip to content

Commit

Permalink
[backend] renaming (#6517)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archidoit committed Apr 4, 2024
1 parent 69e678c commit 3b2cecf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions opencti-platform/opencti-graphql/src/database/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,7 @@ const buildLocalMustFilter = async (validFilter) => {
if (arrayKeys.length > 1) {
throw UnsupportedError('Filter must have only one field', { keys: arrayKeys });
} else {
const schemaKey = schemaAttributesDefinition.getAttributeByName(R.head(arrayKeys));
const filterDefinition = schemaAttributesDefinition.getAttributeByName(R.head(arrayKeys));
let valueFiltering = { // classic filters: field doesn't exist
bool: {
must_not: {
Expand All @@ -1692,8 +1692,8 @@ const buildLocalMustFilter = async (validFilter) => {
}
}
};
if (schemaKey?.type === 'string') {
if (schemaKey?.format === 'text') { // text filters: use wildcard
if (filterDefinition?.type === 'string') {
if (filterDefinition?.format === 'text') { // text filters: use wildcard
valueFiltering = {
bool: {
must_not: {
Expand Down Expand Up @@ -1731,14 +1731,14 @@ const buildLocalMustFilter = async (validFilter) => {
if (arrayKeys.length > 1) {
throw UnsupportedError('Filter must have only one field', { keys: arrayKeys });
} else {
const schemaKey = schemaAttributesDefinition.getAttributeByName(R.head(arrayKeys));
const filterDefinition = schemaAttributesDefinition.getAttributeByName(R.head(arrayKeys));
let valueFiltering = { // classic filters: field exists
exists: {
field: R.head(arrayKeys)
}
};
if (schemaKey?.type === 'string') {
if (schemaKey?.format === 'text') { // text filters: use wildcard
if (filterDefinition?.type === 'string') {
if (filterDefinition?.format === 'text') { // text filters: use wildcard
valueFiltering = {
bool: {
must: {
Expand Down

0 comments on commit 3b2cecf

Please sign in to comment.