diff --git a/app/assets/images/vectara-icon.png b/app/assets/images/vectara-icon.png new file mode 100644 index 000000000..a4608f1b7 Binary files /dev/null and b/app/assets/images/vectara-icon.png differ diff --git a/app/assets/javascripts/controllers/mainCtrl.js b/app/assets/javascripts/controllers/mainCtrl.js index ba6ca2d39..f4007e09a 100644 --- a/app/assets/javascripts/controllers/mainCtrl.js +++ b/app/assets/javascripts/controllers/mainCtrl.js @@ -28,9 +28,9 @@ angular.module('QuepidApp') }; var getSearchEngine = function(tryNo) { - var sett = settingsSvc.editableSettings(); - if (sett.hasOwnProperty('getTry')) { - var aTry = sett.getTry(tryNo); + var settings = settingsSvc.editableSettings(); + if (settings.hasOwnProperty('getTry')) { + var aTry = settings.getTry(tryNo); if (aTry) { return aTry.searchUrl; } diff --git a/app/assets/javascripts/controllers/queryParams.js b/app/assets/javascripts/controllers/queryParams.js index 98a5d2e54..a117850a2 100644 --- a/app/assets/javascripts/controllers/queryParams.js +++ b/app/assets/javascripts/controllers/queryParams.js @@ -21,7 +21,22 @@ angular.module('QuepidApp') $scope.showTLSChangeWarning = false; - $scope.searchEndpoints = searchEndpointSvc.list(); + $scope.haveSearchEndpoints = false; + + searchEndpointSvc.list() + .then(function() { + $scope.searchEndpoints = searchEndpointSvc.searchEndpoints; + if ($scope.searchEndpoints.length > 0) { + $scope.haveSearchEndpoints = true; + } + else { + $scope.haveSearchEndpoints = false; + } + }); + + $scope.listSearchEndpoints = function() { + return $scope.searchEndpoints; + }; $scope.validateSearchEngineUrl = function() { if (!angular.isUndefined($scope.settings.searchUrl)){ @@ -95,6 +110,8 @@ angular.module('QuepidApp') name: $scope.settings.selectedTry.name, number_of_rows: $scope.settings.selectedTry.numberOfRows, query_params: $scope.settings.selectedTry.queryParams, + search_endpoint_id: $scope.settings.selectedTry.searchEndpointId, + endpoint_name: $scope.settings.selectedTry.endpointName, search_engine: $scope.settings.selectedTry.searchEngine, search_url: $scope.settings.selectedTry.searchUrl, try_number: $scope.settings.selectedTry.tryNo, @@ -108,5 +125,11 @@ angular.module('QuepidApp') $scope.settings.reset(); $scope.validateSearchEngineUrl(); }; + + $scope.changeSearchEngine2 = function() { + console.log("In changeSearchEngine2 and we don't do anything here!"); + //$scope.settings.reset(); + //$scope.validateSearchEngineUrl(); + }; } ]); diff --git a/app/assets/javascripts/controllers/settings.js b/app/assets/javascripts/controllers/settings.js index 4f7b3b2a6..56678c485 100644 --- a/app/assets/javascripts/controllers/settings.js +++ b/app/assets/javascripts/controllers/settings.js @@ -3,33 +3,45 @@ angular.module('QuepidApp') .controller('SettingsCtrl', [ - '$scope', - '$location', + '$scope','$location', 'flash', 'settingsSvc', - function ($scope, $location, flash, settingsSvc) { + function ( + $scope, $location, + flash, + settingsSvc + ) { $scope.settingsModel = {}; $scope.pendingSettings = { searchEngine: '', searchUrl: '', - titleField: '' + titleField: '', + searchEndpointId: '' }; - + + $scope.whoami = function() { + console.log("I am settings.js"); + } + $scope.settingsModel.settingsId = function() { return settingsSvc.settingsId(); }; var reset = function() { var currSettings = settingsSvc.editableSettings(); - if ( this.searchEngine !== currSettings.searchEngine) { - currSettings = settingsSvc.pickSettingsToUse($scope.pendingSettings.searchEngine, null); - currSettings.fieldSpec = currSettings.fieldSpec + ', ' + currSettings.additionalFields.join(', '); - $scope.pendingSettings.urlFormat = currSettings.urlFormat; + if ( this.searchEndpointId !== currSettings.searchEndpointId) { + console.log("We don't do this anymore"); + //currSettings = settingsSvc.pickSettingsToUse($scope.pendingSettings.searchEngine, null); + //currSettings.fieldSpec = currSettings.fieldSpec + ', ' + currSettings.additionalFields.join(', '); + //$scope.pendingSettings.urlFormat = currSettings.urlFormat; } + this.searchEndpointId = currSettings.searchEndpointId; + this.endpointName = currSettings.endpointName; this.searchEngine = currSettings.searchEngine; - this.apiMethod = currSettings.apiMethod; + //this.apiMethod = currSettings.apiMethod; + if (false){ if (this.searchEngine === 'solr') { var quepidStartsWithHttps = $location.protocol() === 'https'; if (quepidStartsWithHttps === true){ @@ -42,6 +54,7 @@ angular.module('QuepidApp') else { this.searchUrl = currSettings.searchUrl; } + } this.fieldSpec = currSettings.fieldSpec; diff --git a/app/assets/javascripts/factories/TryFactory.js b/app/assets/javascripts/factories/TryFactory.js index 3e1e40472..8fc844644 100644 --- a/app/assets/javascripts/factories/TryFactory.js +++ b/app/assets/javascripts/factories/TryFactory.js @@ -49,9 +49,12 @@ self.numberOfRows = data.number_of_rows; self.queryParams = data.query_params; self.searchEngine = data.search_engine; + self.searchEndpointId = data.search_endpoint_id; + self.endpointName = data.endpoint_name; self.searchUrl = data.search_url; self.tryNo = data.try_number; self.endpointName = data.endpoint_name; + // transform curator vars to be more angular friendly diff --git a/app/assets/javascripts/services/settingsSvc.js b/app/assets/javascripts/services/settingsSvc.js index e70247800..e2580e5b1 100644 --- a/app/assets/javascripts/services/settingsSvc.js +++ b/app/assets/javascripts/services/settingsSvc.js @@ -359,6 +359,7 @@ angular.module('QuepidApp') settings.numberOfRows = tryToUse.numberOfRows; settings.queryParams = tryToUse.queryParams; settings.searchEngine = tryToUse.searchEngine; + settings.searchEndpointId = tryToUse.searchEndpointId; settings.searchUrl = tryToUse.searchUrl; // TODO: Store type in db?... @@ -428,6 +429,7 @@ angular.module('QuepidApp') payloadTry.field_spec = settingsToSave.fieldSpec; payloadTry.number_of_rows = settingsToSave.numberOfRows; payloadTry.query_params = settingsToSave.selectedTry.queryParams; + payloadSearchEndpoint.search_endpoint_id = settingsToSave.searchEndpointId; payloadSearchEndpoint.search_engine = settingsToSave.searchEngine; payloadSearchEndpoint.endpoint_url = settingsToSave.searchUrl; payloadSearchEndpoint.api_method = settingsToSave.apiMethod; diff --git a/app/assets/templates/views/devQueryParams.html b/app/assets/templates/views/devQueryParams.html index c3a6c2d55..a8873679a 100644 --- a/app/assets/templates/views/devQueryParams.html +++ b/app/assets/templates/views/devQueryParams.html @@ -10,7 +10,10 @@
+ With a static search endpoint there are no query settings to play with ;-(. +
+
@@ -19,11 +22,7 @@ Query Sandbox:
- With a static (snapshot) search endpoint there are no query settings to play with ;-(. -
+{{ queryParamsWarning }}
@@ -59,31 +58,32 @@
- What's this tab do? Knobs allow you to fine tune your search!
- Define variables in your query template with ##
, such as this boost: title^##titleBoost##
.
- Play with the values in this tab. Submit to rerun with the new values!
-
- With a static (snapshot) search endpoint there are no tuning knobs to play with ;-(. -
- -- Add and remove knobs from here by editing your query. +
+ With a static search endpoint there are tuning knobs to play with ;-(.
-- Tip: Your URL should look like this {{settings.urlFormat}}. +
+ Name: {{ settings.selectedTry.endpointName }}
+ {{settings.searchUrl}} + ++ More
@@ -216,44 +203,6 @@ Tuning Knobs
- - - - - -
-