0

我正在使用包含多个字段的数据集。我需要同时对多个字段进行搜索。Weaviate 与现场搜索兼容吗?如果是这种情况,如果您能指导我如何组合许多搜索查询,我将不胜感激。

这是一个方案:

  schema = {
        "classes": [{
                "class": "Post",
                "vectorizer": "none", # explicitly tell Weaviate not to vectorize anything, we are providing the vectors ourselves through our BERT model
                "properties": [{
                    "name":"pmid",
                    "dataType": ["int"],
                },
                {
                    "name":"title",
                    "dataType": ["text"],
                },
                {
                     "name": "body",
                    "dataType": ["text"],
                }, 
                {
                    "name":"summary",
                    "dataType": ["text"],
                }]
        }]
    }

我想同时搜索正文和摘要。例如,它识别在正文和摘要中包含“HIV”一词的出版物。

4

1 回答 1

0

这当然是可能的。查看Weaviate 文档中的where-filter :-)

基于您的示例架构的示例。

{
  Get {
    Post(
      nearVector: {
        vector: [0, 0, 0] # <== your custom vector
      }
      where: { # <== searching for a pmid > 12
        operator: GreaterThan
        valueInt: 12
        path: ["pmid"]
      }
    ) {
      pmid
      title
    }
  }
}
于 2022-02-02T16:47:21.423 回答