[英]Is it possible to get the which "where" condition is matched in Vespa.ai?
I have a use case where I need to find out which "where" condition of the query is matched to get the result if we provided multiple conditions.我有一个用例,如果我们提供了多个条件,我需要找出查询的哪个“where”条件匹配才能获得结果。
for example-例如-
we have organization data, where we have employee name, city, technology and hobbies.我们有组织数据,其中有员工姓名、城市、技术和爱好。
Now we have 3 conditions that are- 1. we need to get the records where the city is FOO_CITY.现在我们有 3 个条件: 1. 我们需要获取城市为 FOO_CITY 的记录。 2. we need to get the records where the technology is FOO_TECH. 2.我们需要获取技术为FOO_TECH的记录。 3. we need to get the records where the hobby is FOO_BLOG. 3.我们需要获取hobby所在的记录FOO_BLOG。
when we write the query we get the output rows which satisfies these condition but I need to find out which condition is satisfied from all the above three.当我们编写查询时,我们得到满足这些条件的输出行,但我需要从以上三个条件中找出满足哪个条件。
You can ask Vespa to produce summary rank features which you can consume in your middle tier or in a searcher plugin.您可以要求 Vespa 生成汇总排名功能,您可以在中间层或搜索器插件中使用这些功能。
See https://docs.vespa.ai/documentation/ranking.html .请参阅https://docs.vespa.ai/documentation/ranking.html 。
Set of built in rank features https://docs.vespa.ai/documentation/reference/rank-features.html一组内置排名功能https://docs.vespa.ai/documentation/reference/rank-features.html
Given that we have 3 fields, city, technology and hobby:鉴于我们有 3 个领域,城市、技术和爱好:
rank-profile what-matched-my-query {
first-phase {
expression: something
}
summary-features {
matches(city)
matches(technology)
matches(hobby)
}
}
/search/?yql=s..;&ranking=what-matched-my-query /search/?yql=s..;&ranking=what-matched-my-query
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.