"type" in freebase suggest results got dropped so we need to fetch the result's types ourselves.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@409 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
c921fb703f
commit
302c27687c
@ -9,7 +9,7 @@
|
|||||||
schemaPrefixes.push(includedTypes[i] + "/");
|
schemaPrefixes.push(includedTypes[i] + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
var results = data.result;
|
var results = "result" in data ? data.result : [];
|
||||||
var entries1 = [];
|
var entries1 = [];
|
||||||
var entries2 = [];
|
var entries2 = [];
|
||||||
|
|
||||||
|
@ -208,12 +208,24 @@ DataTableCellUI.prototype._searchForMatch = function() {
|
|||||||
var match = null;
|
var match = null;
|
||||||
var commit = function() {
|
var commit = function() {
|
||||||
if (match != null) {
|
if (match != null) {
|
||||||
|
var query = {
|
||||||
|
"id" : match.id,
|
||||||
|
"type" : []
|
||||||
|
};
|
||||||
|
var baseUrl = "http://api.freebase.com/api/service/mqlread";
|
||||||
|
var url = baseUrl + "?" + $.param({ query: JSON.stringify({ query: query }) }) + "&callback=?";
|
||||||
|
|
||||||
|
$.getJSON(
|
||||||
|
url,
|
||||||
|
null,
|
||||||
|
function(o) {
|
||||||
|
var types = "result" in o ? o.result.type : [];
|
||||||
var params = {
|
var params = {
|
||||||
judgment: "matched",
|
judgment: "matched",
|
||||||
topicID: match.id,
|
topicID: match.id,
|
||||||
topicGUID: match.guid,
|
topicGUID: match.guid,
|
||||||
topicName: match.name,
|
topicName: match.name,
|
||||||
types: $.map(match.type, function(elmt) { return elmt.id; }).join(",")
|
types: $.map(types, function(elmt) { return elmt.id; }).join(",")
|
||||||
};
|
};
|
||||||
if (elmts.checkSimilar[0].checked) {
|
if (elmts.checkSimilar[0].checked) {
|
||||||
params.similarValue = self._cell.v;
|
params.similarValue = self._cell.v;
|
||||||
@ -228,6 +240,9 @@ DataTableCellUI.prototype._searchForMatch = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DialogSystem.dismissUntil(level - 1);
|
DialogSystem.dismissUntil(level - 1);
|
||||||
|
},
|
||||||
|
"jsonp"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user