java Google应用程序引擎搜索API赋予某些字段比其他字段更高的优先级
我只是在调查谷歌应用程序引擎的能力,对它的搜索api非常感兴趣。我喜欢你如何定义不同的字段来自动标记,并以不同的方式对搜索结果进行排序
我的问题是,你能以某种方式对结果进行排序,使某些字段比其他字段获得更高的优先级吗
例如:
有两个字段的文档,标题和正文。如果与标题匹配的搜索查询比与正文匹配的查询排名更高,这将是一个问题
这可能吗
干杯
你可以在下面搜索框中键入要查询的问题!
我只是在调查谷歌应用程序引擎的能力,对它的搜索api非常感兴趣。我喜欢你如何定义不同的字段来自动标记,并以不同的方式对搜索结果进行排序
我的问题是,你能以某种方式对结果进行排序,使某些字段比其他字段获得更高的优先级吗
例如:
有两个字段的文档,标题和正文。如果与标题匹配的搜索查询比与正文匹配的查询排名更高,这将是一个问题
这可能吗
干杯
# 1 楼答案
不幸的是,目前还不可能。从文件中:
在您的用例中,您可以在一个查询中检索标题匹配的文档,然后在第二个查询中检索正文匹配的文档。显然,您可以指定不同的规则(甚至一组规则),例如:
等等。当然,规则取决于您的域以及您尝试对文档进行优先级排序的方式