static getQuery (req, res) {
    SessionAPIs.buildSessionQuery(req, (bsqErr, query, indices) => {
      if (bsqErr) {
        return res.send({
          recordsTotal: 0,
          recordsFiltered: 0,
          error: bsqErr.toString()
        });
      }

      if (req.query.fields) {
        query._source = false;
        query.fields = ViewerUtils.queryValueToArray(req.query.fields);
      }

      res.send({ esquery: query, indices });
    });
  }
POST/GET - /api/buildquery

This API allows you to build the query that Arkime viewer would use so you can use yourself against OpenSearch/Elasticsearch.

@name /buildquery
@param {SessionsQuery} See_List - This API supports a common set of parameters documented in the SessionsQuery section
@returns {object} query - The elasticsearch query
@returns {object} indices - The elasticsearch indices that contain sessions in this query
@example
  Returns the OpenSearch/Elasticsearch query for all the sessions with the source IP of 1.2.3.4
  curl -v 'http://localhost:8005/api/buildquery?date=-1&expression=ip.src%3D%3D1.2.3.4'