async searchProfiles(request) {
    const size = this._getSearchPageSize(request);
    const { from, scrollTTL, searchBody } = request.getSearchParams();
    const lang = request.getLangParam();
    const body = request.getBody({});

    if (body.roles && body.query) {
      throw new BadRequestError(
        'You cannot specifify both "roles" and "query". Prefer the usage of "query" property with a search query.',
      );
    }

    if (body.roles) {
      const roles = request.getBodyArray("roles");

      request.addDeprecation(
        "auto-version",
        'Usage of the "roles" property is deprecated. Prefer the usage of "query" property with a search query.',
      );

      if (roles.length > 0) {
        searchBody.query = { terms: { "policies.roleId": roles } };
      } else {
        searchBody.query = { match_all: {} };
      }
      delete body.roles;
    }

    if (lang === "koncorde") {
      searchBody.query = await this.translateKoncorde(searchBody.query || {});
    }

    const response = await this.ask(
      "core:security:profile:search",
      searchBody,
      {
        from,
        scroll: scrollTTL,
        size,
      },
    );

    response.hits = response.hits.map(formatProcessing.serializeProfile);

    return response;
  }
Search for profiles

@param {Request} request
@returns {Promise<Object>}