gpt4 book ai didi

javascript - MISMATCHED_SEARCH_PARENTHESIS : Search error: Parentheses are unbalanced

转载 作者:行者123 更新时间:2023-11-30 21:15:14 26 4
gpt4 key购买 nike

当我在下面运行 testThatFails 时,出现以下错误:

MISMATCHED_SEARCH_PARENTHESIS : Search error: Parentheses are unbalanced.

为什么会出现该错误?

如果我将 is 更改为 haskeywords,它将起作用 (testThatSucceeds)。

如果我取出 ,"AND",["line","equalto","1"],它会起作用 (anotherTestThatSucceeds)。

如果我将 numbertext 更改为 number,它将起作用 (yetAnotherTestThatSucceeds)。

define(['N/search'], function (nSearch) {

function testThatFails() {
var objSearch = nSearch.create({
type: 'transaction',
filters: [[["numbertext","is","1"],"AND",["line","equalto","1"]]],
columns: [nSearch.createColumn({
name: 'internalid'
})]
});

var resultSet = objSearch.run();

resultSet.getRange({ start: 0, end: 1000 });
}

function testThatSucceeds() {
var objSearch = nSearch.create({
type: 'transaction',
filters: [[["numbertext","haskeywords","1"],"AND",["line","equalto","1"]]],
columns: [nSearch.createColumn({
name: 'internalid'
})]
});

var resultSet = objSearch.run();

resultSet.getRange({ start: 0, end: 1000 });
}

function anotherTestThatSucceeds() {
var objSearch = nSearch.create({
type: 'transaction',
filters: [[["numbertext","is","1"]]],
columns: [nSearch.createColumn({
name: 'internalid'
})]
});

var resultSet = objSearch.run();

resultSet.getRange({ start: 0, end: 1000 });
}

function yetAnotherTestThatSucceeds() {
var objSearch = nSearch.create({
type: 'transaction',
filters: [[["number","is","1"],"AND",["line","equalto","1"]]],
columns: [nSearch.createColumn({
name: 'internalid'
})]
});

var resultSet = objSearch.run();

resultSet.getRange({ start: 0, end: 1000 });
}
});

最佳答案

numbertext 字段未列为 supported filter .您可以使用它来过滤您的搜索,但它可能会导致意外行为。您应该改用 number

关于javascript - MISMATCHED_SEARCH_PARENTHESIS : Search error: Parentheses are unbalanced,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45745552/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com