diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index e334f9c67..c94a65b2d 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -461,7 +461,7 @@ "valid-values": "Valid values", "blanks": "Blanks", "errors": "Errors", - "search-fb-topic": "Search Freebase for a topic to match all filtered cells:", + "search-fb-topic": "Search for an item to match all filtered cells:", "copy-recon-judg": "Copy recon judgments from column", "copy-to-col": "Copy to Columns", "copy-opt": "Copying Options", diff --git a/main/webapp/modules/core/langs/translation-fr.json b/main/webapp/modules/core/langs/translation-fr.json index 137e7a2e2..6b920a88a 100644 --- a/main/webapp/modules/core/langs/translation-fr.json +++ b/main/webapp/modules/core/langs/translation-fr.json @@ -504,7 +504,7 @@ "re-trans": "Retransformer", "custom-text-facet": "Personnaliser la facette textuelle", "match-other": "Apparier les autres cellules avec le même contenu", - "search-fb-topic": "Chercher dans Freebase un sujet qui correspond à toutes les cellules filtrées :", + "search-fb-topic": "Chercher un item qui correspond à toutes les cellules filtrées :", "from-col": "De la colonne", "custom-numeric-label": "Facette numérique personnalisée sur la colonne", "start-recon": "Démarrer la réconciliation", diff --git a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js index d67654747..df2bb36d2 100644 --- a/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js +++ b/main/webapp/modules/core/scripts/views/data-table/menu-reconcile.js @@ -73,6 +73,20 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { }; var doSearchToMatch = function() { + var serviceUrl = null; + var service = null; + var suggestOptions = {}; + if (column.reconConfig) { + serviceUrl = column.reconConfig.service; + } + if (serviceUrl) { + service = ReconciliationManager.getServiceFromUrl(serviceUrl); + } + if (service && service.suggest && service.suggest.entity) { + suggestOptions = $.extend({}, service.suggest.entity); + suggestOptions.query_param_name = "prefix"; + } + var frame = DialogSystem.createDialog(); frame.width("400px"); @@ -84,36 +98,24 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) { var input = $('').appendTo($('
').appendTo(body)); - input.suggest({}).bind("fb-select", function(e, data) { - var query = { - "id" : data.id, - "type" : [] - }; - var baseUrl = "https://www.googleapis.com/freebase/v1/mqlread?key=" + Freebase.API_KEY + "&"; - var url = baseUrl + $.param({ query: JSON.stringify(query) }) + "&callback=?"; + input.suggest(suggestOptions).bind("fb-select", function(e, data) { + var types = data.notable ? data.notable : []; - $.getJSON( - url, + Refine.postCoreProcess( + "recon-match-specific-topic-to-cells", + { + columnName: column.name, + topicID: data.id, + topicName: data.name, + types: types.join(","), + identifierSpace: service.identifierSpace, + schemaSpace: service.schemaSpace + }, null, - function(o) { - var types = "result" in o ? o.result.type : []; + { cellsChanged: true, columnStatsChanged: true } + ); - Refine.postCoreProcess( - "recon-match-specific-topic-to-cells", - { - columnName: column.name, - topicID: data.id, - topicGUID: data.guid, - topicName: data.name, - types: types.join(",") - }, - null, - { cellsChanged: true, columnStatsChanged: true } - ); - - DialogSystem.dismissUntil(level - 1); - } - ); + DialogSystem.dismissUntil(level - 1); }); $('').text($.i18n._('core-buttons')["cancel"]).click(function() {