-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Hi suhas,
Is it possible to refactor some of the query building logic into modules? I want to separate parts of the process into nodejs modules. but when I do this I get the title error.
I posted the full question here
Perhaps it's not possible?
Like this:
import esb from 'elastic-builder';
import { ToElasticFilter } from 'filtermodule';
import { ToElasticSort } from 'sortmodule';
const run = () => {
// add any customers filters here
const boolBody = ToElasticFilter(); // esb.boolQuery().must(esb.regexpQuery('catch_all', `.*test.*`).flags('NONE'));
// apply the sorting here
const s = ToElasticSort(); // esb.sort('catch_all', 'asc').missing('_last').mode('max').unmappedType('keyword');
// build the base query here
const body = esb.requestBodySearch().query(boolBody).sort(s);
console.log(JSON.stringify(body.toJSON(), null, 2));
};
run();Thank you for your time and work.
Metadata
Metadata
Assignees
Labels
No labels