Skip to content

Commit

Permalink
enabling VFBu id's to bypass query search
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbie1977 committed Jun 28, 2024
1 parent 1ba72aa commit 5cc25c3
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions geppetto-client/js/components/interface/query/queryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,45 @@ define(function (require) {
if (Object.prototype.hasOwnProperty.call(that.configuration.DataSources, key)) {
var dataSource = that.configuration.DataSources[key];
var searchQuery = $("#query-typeahead").val();
var url = dataSource.url.replace(/\$SEARCH_TERM\$/g, searchQuery);
that.updateResults = true;
that.requestDataSourceResults(key, url, dataSource.crossDomain);
// Hack to pass through VFBu bypassing SOLR call
if (searchQuery.includes("VFBu_")) {
that.QueryBuilder.updateDataSourceResults("VFB", {
"responseHeader": {
"status": 0,
"QTime": 218,
"params": {
"q": searchQuery + " OR " + searchQuery + "* OR *" + searchQuery + "*",
"defType": "edismax",
"qf": "label^100 synonym^100 label_autosuggest_ws label_autosuggest_e label_autosuggest synonym_autosuggest_ws synonym_autosuggest shortform_autosuggest",
"indent": "true",
"fl": "short_form label synonym id facets_annotation type:\"class\"",
"pf": "true",
"start": "0",
"rows": "100",
"wt": "json",
"bq": "shortform_autosuggest:VFB*^110.0 shortform_autosuggest:FBbt*^100.0 label_s:\"\"^2 synonym_s:\"\" short_form=FBbt_00003982^2 facets_annotation:Deprecated^0.001"
}
},
"response": {
"numFound": 1,
"start": 0,
"numFoundExact": true,
"docs": [
{
"label": "Uploaded Data " + searchQuery,
"short_form": searchQuery,
"facets_annotation": ["Entity", "Anatomy", "Individual", "Nervous_system", "has_image"],
"id": "http://virtualflybrain.org/reports/" + searchQuery,
"type": "class"
}
]
}
});
} else {
var url = dataSource.url.replace(/\$SEARCH_TERM\$/g, searchQuery);
that.updateResults = true;
that.requestDataSourceResults(key, url, dataSource.crossDomain);
}
}
}
}, 150);
Expand Down

0 comments on commit 5cc25c3

Please sign in to comment.