Skip to content

Commit

Permalink
OMG, turns out the explain API url has changed in OS and ES7+, and we…
Browse files Browse the repository at this point in the history
… have the old urls... (#124)
  • Loading branch information
epugh authored Jun 9, 2023
1 parent 678e2f0 commit 08beea0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion services/esUrlSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ angular.module('o19s.splainer-search')
var url = self.buildBaseUrl(uri);

url = url + '/' + index + '/';
if (type) {
if (!addExplain && type) {
url = url + type + '/';
}

Expand Down
6 changes: 3 additions & 3 deletions test/spec/esSearchSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ describe('Service: searchSvc: ElasticSearch', function() {
$httpBackend.expectPOST(url).respond(200, expectedResponse);

angular.forEach(expectedDocs, function(doc) {
var explainUrl = "http://localhost:9200/statedecoded/law/";
var explainUrl = "http://localhost:9200/statedecoded/";
explainUrl += '_explain/' + doc._id;
$httpBackend.expectPOST(explainUrl).respond(200, expectedExplainResponse);
});
Expand All @@ -1123,7 +1123,7 @@ describe('Service: searchSvc: ElasticSearch', function() {
$httpBackend.expectPOST(url).respond(200, expectedResponse);

angular.forEach(expectedDocs, function(doc) {
var explainUrl = "http://localhost:9200/statedecoded/law/";
var explainUrl = "http://localhost:9200/statedecoded/";
explainUrl += '_explain/' + doc._id;
$httpBackend.expectPOST(explainUrl).respond(200, expectedExplainResponse);
});
Expand All @@ -1145,7 +1145,7 @@ describe('Service: searchSvc: ElasticSearch', function() {
$httpBackend.expectPOST(url).respond(200, expectedResponse);

angular.forEach(expectedDocs, function(doc) {
var explainUrl = "http://localhost:9200/statedecoded/law/";
var explainUrl = "http://localhost:9200/statedecoded/";
explainUrl += '_explain/' + doc._id;
$httpBackend.expectPOST(explainUrl).respond(200, expectedExplainResponse);
});
Expand Down
2 changes: 1 addition & 1 deletion test/spec/esUrlSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('Service: esUrlSvc', function () {
it('builds a proper doc explain URL from the doc info', function() {
var docUrl = esUrlSvc.buildExplainUrl(uri, doc);

expect(docUrl).toBe('http://localhost:9200/tmdb/movies/_explain/1');
expect(docUrl).toBe('http://localhost:9200/tmdb/_explain/1');
});
});

Expand Down

0 comments on commit 08beea0

Please sign in to comment.