Skip to content

Commit

Permalink
Merge pull request #4 from Financial-Times/index-patch
Browse files Browse the repository at this point in the history
Use the old index name
  • Loading branch information
sjparkinson authored Apr 3, 2017
2 parents e02e587 + e2a5c5b commit 45c8cd9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function get (uuid, options = {}, timeout = 3000) {
const params = Object.assign({}, DEFAULTS, options);
const qs = stringifyOptions(params);

return signedFetch(`https://next-elastic.ft.com/content/item/${uuid}/_source?${qs}`, {
return signedFetch(`https://next-elastic.ft.com/v3_api_v2/item/${uuid}/_source?${qs}`, {
timeout,
method: 'GET'
})
Expand Down
2 changes: 1 addition & 1 deletion lib/mget.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function mget (options = {}, timeout = 3000) {
const params = Object.assign({}, DEFAULTS, options);
const body = JSON.stringify(params);

return signedFetch('https://next-elastic.ft.com/content/item/_mget', {
return signedFetch('https://next-elastic.ft.com/v3_api_v2/item/_mget', {
body,
timeout,
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion lib/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function search (options = {}, timeout = 3000) {
const params = Object.assign({}, DEFAULTS, options);
const body = JSON.stringify(params);

return signedFetch('https://next-elastic.ft.com/content/item/_search', {
return signedFetch('https://next-elastic.ft.com/v3_api_v2/item/_search', {
body,
timeout,
method: 'POST',
Expand Down
6 changes: 3 additions & 3 deletions test/spec/get-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Get', () => {
context('With options', () => {
it('accepts a source parameter', () => {
nock('https://next-elastic.ft.com')
.get(`/content/item/${fixture.id}/_source`)
.get(`/v3_api_v2/item/${fixture.id}/_source`)
.query((params) => {
return params._source === 'id,title';
})
Expand All @@ -27,7 +27,7 @@ describe('Get', () => {
context('Response - found', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.get(`/content/item/${fixture.id}/_source`)
.get(`/v3_api_v2/item/${fixture.id}/_source`)
.query(true)
.reply(200, fixture);
});
Expand All @@ -42,7 +42,7 @@ describe('Get', () => {
context('Response - not found', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.get(`/content/item/${fixture.id}/_source`)
.get(`/v3_api_v2/item/${fixture.id}/_source`)
.query(true)
.reply(404);
});
Expand Down
10 changes: 5 additions & 5 deletions test/spec/mget-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Multi get', () => {
const ids = [123, 456, 789];

nock('https://next-elastic.ft.com')
.post('/content/item/_mget', (body) => {
.post('/v3_api_v2/item/_mget', (body) => {
return body.ids.every((id, i) => id === ids[i]);
})
.reply(200, fixtureWithResults);
Expand All @@ -29,7 +29,7 @@ describe('Multi get', () => {
const source = 'id,title';

nock('https://next-elastic.ft.com')
.post('/content/item/_mget', (body) => {
.post('/v3_api_v2/item/_mget', (body) => {
return body._source === source;
})
.reply(200, fixtureWithResults);
Expand All @@ -41,7 +41,7 @@ describe('Multi get', () => {
context('Response - with results', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_mget')
.post('/v3_api_v2/item/_mget')
.reply(200, fixtureWithResults);
});

Expand All @@ -64,7 +64,7 @@ describe('Multi get', () => {
context('Response - no results', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_mget')
.post('/v3_api_v2/item/_mget')
.reply(200, fixtureNoResults);
});

Expand All @@ -84,7 +84,7 @@ describe('Multi get', () => {
context('Response - error', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_mget')
.post('/v3_api_v2/item/_mget')
.reply(500);
});

Expand Down
10 changes: 5 additions & 5 deletions test/spec/search-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Search', () => {
const size = 20;

nock('https://next-elastic.ft.com')
.post('/content/item/_search', (body) => {
.post('/v3_api_v2/item/_search', (body) => {
return body.from === from && body.size === size;
})
.reply(200, fixtureWithResults);
Expand All @@ -31,7 +31,7 @@ describe('Search', () => {
const source = 'id,title';

nock('https://next-elastic.ft.com')
.post('/content/item/_search', (body) => {
.post('/v3_api_v2/item/_search', (body) => {
return body._source === source;
})
.reply(200, fixtureWithResults);
Expand All @@ -43,7 +43,7 @@ describe('Search', () => {
context('Response - with results', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_search')
.post('/v3_api_v2/item/_search')
.reply(200, fixtureWithResults);
});

Expand All @@ -64,7 +64,7 @@ describe('Search', () => {
context('Response - no results', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_search')
.post('/v3_api_v2/item/_search')
.reply(200, fixtureNoResults);
});

Expand Down Expand Up @@ -92,7 +92,7 @@ describe('Search', () => {
context('Response - error', () => {
beforeEach(() => {
nock('https://next-elastic.ft.com')
.post('/content/item/_search')
.post('/v3_api_v2/item/_search')
.reply(400, fixtureError);
});

Expand Down

0 comments on commit 45c8cd9

Please sign in to comment.