filter output when searching for jobs
This commit is contained in:
@@ -228,6 +228,9 @@ export default class Job extends events.EventEmitter {
|
|||||||
_getPendingJobs() {
|
_getPendingJobs() {
|
||||||
const nowTime = moment().toISOString();
|
const nowTime = moment().toISOString();
|
||||||
const query = {
|
const query = {
|
||||||
|
_source : {
|
||||||
|
exclude: [ 'output.content' ]
|
||||||
|
},
|
||||||
query: {
|
query: {
|
||||||
constant_score: {
|
constant_score: {
|
||||||
filter: {
|
filter: {
|
||||||
|
|||||||
@@ -221,6 +221,13 @@ describe('Worker class', function () {
|
|||||||
clock.restore();
|
clock.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should filter unwanted source data', function () {
|
||||||
|
const excludedFields = [ 'output.content' ];
|
||||||
|
const { body } = getSearchParams(jobtype);
|
||||||
|
expect(body).to.have.property('_source');
|
||||||
|
expect(body._source).to.eql({ exclude: excludedFields });
|
||||||
|
});
|
||||||
|
|
||||||
it('should search by job type', function () {
|
it('should search by job type', function () {
|
||||||
const { body } = getSearchParams(jobtype);
|
const { body } = getSearchParams(jobtype);
|
||||||
const conditions = get(body, conditionPath);
|
const conditions = get(body, conditionPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user