游离碱search_api并通过指定的类型不计成绩 [英] Freebase search_api and excluding results by specified type
问题描述
时,任何人都知道,如何排除某些主题用搜索API和MQL指定类型(S)?
is anyone know, how to exclude some topics with specified type(s) using search api and mql?
例如我是试图找到所有主题巫毒人,只有那些排除,有成分和释放类型,以及按分数降序排序的结果:的 http://tinyurl.com/3tjkb7y 。
排序工作完美,但我不能排除发现功能:(
我尝试使用mql_filter: http://tinyurl.com/644xkow ,但释放仍然存在。
还有一个问题:我在type_strict参数的可能值看:全部,所有,应该。但是不或不在没有价值。是可以以任何其他方式获得所需的结果呢?
For example i'm try to find all topics "Voodoo People", and exclude only those, that have composition and release types, and sort result by score desc: http://tinyurl.com/3tjkb7y. Sorting work perfect, but i can't find functionality for excluding :( I'm try to use mql_filter: http://tinyurl.com/644xkow, but releases still there. And one more question: i see in type_strict param possible values: "all", "any", "should". But there is no value "not" or "not in". Is needed result can be obtained in any other way?
推荐答案
这是你要找的语法的可选:禁止的。在您的查询应该是这样的:
The syntax that you're looking for is "optional" : "forbidden". In your query that would look like this:
[{
"search": {
"query": "Voodoo People",
"score": null,
"mql_filter": [{
"type": {
"id": "/music/release",
"optional": "forbidden"
}
}]
},
"name": null,
"id": null,
"type": [],
"/common/topic/notable_for": {
},
"limit": 15,
"sort": "-search.score"
}]
这篇关于游离碱search_api并通过指定的类型不计成绩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!