diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 9307788b8..08eb6691b 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -190,7 +190,17 @@ def index } bmr = Benchmark.ms { - render json: DoiSerializer.new(results, options).serialized_json, status: :ok + logger.info params[:fields] + # support sparse fieldsets + if params[:fields] + f = params.to_unsafe_h.dig(:fields) + f = { dois: "doi" } unless f.is_a?(Hash) + f.each { |k, v| f[k] = v.split(",") } + + render json: DoiSerializer.new(results, options.merge(fields: f)).serialized_json, status: :ok + else + render json: DoiSerializer.new(results, options).serialized_json, status: :ok + end } if bmr > 3000 diff --git a/docker-compose.yml b/docker-compose.yml index 1f0a67b8e..ef9884995 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,7 +44,7 @@ services: - "9301:9300" environment: discovery.type: single-node - ES_JAVA_OPTS: -Xms1g -Xmx1g + ES_JAVA_OPTS: -Xms512m -Xmx512m ELASTIC_PASSWORD: changeme xpack.security.enabled: "false" http.cors.enabled: "true"