【问题标题】:How to customize link properties when creating ArangoSearchView in ArangoJS在 ArangoJS 中创建 ArangoSearchView 时如何自定义链接属性
【发布时间】:2020-11-19 23:38:04
【问题描述】:

我尝试在 arangojs 中创建一个 ArangoSearchView,但我不知道如何设置视图属性。 这是我的代码:

const link = {
    includeAllFields: true,
    fields: { val: { analyzers: ["text_en"] } },
    storeValues: "val"
};
const view = _db.view(`${_viewName}`);
await view.create({ links: {mergeDB : link } });

但是,我得到了这个结果:

【问题讨论】:

    标签: node.js arangodb arangojs


    【解决方案1】:

    正如错误所说,它与 storeValue 字段有关

    根据文档,值应该是none(默认)或id

    storeValues (optional; type: string; default: "none")
    
    This property controls how the view should keep track of the attribute values. Valid values are:
    
    none: Do not store value meta data in the View.
    id: Store information about value presence to allow use of the EXISTS() function.
    
    Not to be confused with storedValues, which stores attribute values in the View index.
    

    请注意,还有一个名为 storedValues 的参数,但它是顶级字段(与 links 相同的级别)

    【讨论】:

    • 哦,我忘了空格只能是 None 或 id。非常感谢:D
    猜你喜欢
    • 2011-06-20
    • 2011-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多