在 Vespa 中创建代码片段
Snippet creation in Vespa
YQL(简体):
select * from sources * where language contains "de" and description contains "computer";
结果(简体):
{
"root": {
...
"children": [
{
"id": "id:post:post::123",
"relevance": 0,
"source": "content",
"fields": {
"sddocname": "post",
"description": "<sep /> coffee machine <hi>de</hi> longhi contains a <hi>computer</hi> <sep />",
}
}
]
}
}
如何告诉 Vespa 从 "computer" 而不是从 "de" 创建片段?
使用 "filter" 注释,https://docs.vespa.ai/documentation/reference/query-language-reference.html。带有 filter: true 的术语不会被突出显示。
select * from sources * where language contains ([{"filter":true}]"de") and description contains "computer";
YQL(简体):
select * from sources * where language contains "de" and description contains "computer";
结果(简体):
{
"root": {
...
"children": [
{
"id": "id:post:post::123",
"relevance": 0,
"source": "content",
"fields": {
"sddocname": "post",
"description": "<sep /> coffee machine <hi>de</hi> longhi contains a <hi>computer</hi> <sep />",
}
}
]
}
}
如何告诉 Vespa 从 "computer" 而不是从 "de" 创建片段?
使用 "filter" 注释,https://docs.vespa.ai/documentation/reference/query-language-reference.html。带有 filter: true 的术语不会被突出显示。
select * from sources * where language contains ([{"filter":true}]"de") and description contains "computer";