相当于:"Could not add an item of type WORD_ALTERNATIVES"

equiv: "Could not add an item of type WORD_ALTERNATIVES"

在空 table 上使用 equiv() 会在 vespa.ai 7.99.22 中抛出一个奇怪的错误:

Could not add an item of type WORD_ALTERNATIVES: Equiv can only have word/int/phrase as children

定义:

search post {
    document post {
        field description type string {
            indexing: summary | index
            stemming: multiple
        }
    }
    fieldset text {
        fields: description
    }
}

查询(table post 中没有行):

curl -s -H "Content-Type: application/json"
    --data '{"yql" : "select * from post where text contains equiv(\"Q123\",\"Q456\");"}'
    http://localhost:8080/search/ | jq .

结果:

{
  "root": {
    "id": "toplevel",
    "relevance": 1,
    "fields": {
      "totalCount": 0
    },
    "errors": [
      {
        "code": 4,
        "summary": "Invalid query parameter",
        "source": "content",
        "message": "Could not add an item of type WORD_ALTERNATIVES: Equiv can only have word/int/phrase as children"
      }
    ]
  }
}

有什么问题?

使用 stemming:multiple 会导致 WordAlternativesItem 不是 EquivItem 的允许子项,因此不支持此组合。

但是,我们认为这是不必要的限制。我现在解除这个限制,如果风向好,请在下一个版本中重试,应该在周一(2019-09-16)发布。