Skip to content

Development Tips and Tricks

Michal Töpfer edited this page May 13, 2024 · 2 revisions

Development Tips and Tricks

Disable JS minifying in templates

In server/services/builder.js, in function getWebpackConfig, you can set the mode to 'development' (instead of the default 'production'). This will disable the minifying of JavaScript when compiling templates, which is quite useful for debugging.

Logging Data Access Queries

Client

In the query function of DataAcess class (client/src/ivis/DataAccess.js), the queries are formed and sent to the server. A good place for logging is right after the query is created (inside the loop). For example, the log can be added here (link to a specific line at the time of writing this) by

console.log("query", qry);

These queries conform to the format described in Data Access from Templates (Queries).

Server - Elasticsearch

The Elasticsearch queries are executed in the executeElsQry function in server/lib/indexers/elasticsearch-query.js. The queries can be logged (in a human-readable format) by adding the following line to the beginning of the function:

log.verbose("ES query", util.inspect(body, false, null, true));

and the following import:

const util = require('util');

For query format reference, see Elasticsearch Guide.

Clone this wiki locally