diff --git a/core/Changes b/core/Changes
index 9b7e5b6..8ce8948 100644
--- a/core/Changes
+++ b/core/Changes
@@ -5,6 +5,8 @@
    - Updated search krill error handling (margaretha)
 18/02/2019
    - Updated handling errors from Koral (margaretha)
+19/02/2019
+   - Added fields to metadata controller (margaretha, issue #39)   
 
 # version 0.61.5
 17/12/2018
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 87f0838..35c99c6 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -98,6 +98,9 @@
     private String secureRandomAlgorithm;
     private String messageDigestAlgorithm;
 
+    // EM: metadata restriction
+    // another variable might be needed to define which metadata fields are restricted 
+    private boolean isMetadataRestricted = false;
     
     public KustvaktConfiguration (Properties properties) throws Exception {
         load(properties);
diff --git a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
index ca63c08..3a30fa2 100644
--- a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
+++ b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
@@ -166,16 +166,21 @@
         }
         
         if (fields != null && !fields.isEmpty()){
-            String[] fieldArray = fields.split(",");
-            List<String> fieldList = new ArrayList<>(fieldArray.length);
-            for (String field :  fieldArray){
-                fieldList.add(field.trim());
-            }
+            List<String> fieldList = convertFieldsToList(fields);
             meta.addEntry("fields", fieldList);
         }
         return meta;
     }
 
+    private List<String> convertFieldsToList (String fields) {
+        String[] fieldArray = fields.split(",");
+        List<String> fieldList = new ArrayList<>(fieldArray.length);
+        for (String field :  fieldArray){
+            fieldList.add(field.trim());
+        }
+        return fieldList;
+    }
+    
     private String searchNeo4J (String query, int pageLength,
             MetaQueryBuilder meta, boolean raw) throws KustvaktException {
 
@@ -260,14 +265,21 @@
     }
 
     public String retrieveDocMetadata (String corpusId, String docId,
-            String textId, String username, HttpHeaders headers)
+            String textId, String fields, String username, HttpHeaders headers)
             throws KustvaktException {
-        User user = createUser(username, headers);
-        Pattern p = determineAvailabilityPattern(user);
+        List<String> fieldList = null;
+        if (fields != null && !fields.isEmpty()){
+            fieldList = convertFieldsToList(fields);
+        }
+        Pattern p = null;
+        if (config.isMetadataRestricted()){
+            User user = createUser(username, headers);
+            p = determineAvailabilityPattern(user);
+        }
         String textSigle = searchKrill.getTextSigle(corpusId, docId, textId);
-        return searchKrill.getFields(textSigle, p);
+        return searchKrill.getFields(textSigle, fieldList, p);
     }
-
+    
     public String getCollocationBase (String query) throws KustvaktException {
         return graphDBhandler.getResponse("distCollo", "q", query);
     }
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index 0580d7e..4ed62d9 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -164,7 +164,7 @@
     /*
      * Retrieve the meta fields for a certain document
      */
-    public String getFields (String id, Pattern licensePattern)
+    public String getFields (String id, List<String> fields, Pattern licensePattern)
             throws KustvaktException {
         MetaFields meta;
 
@@ -175,16 +175,24 @@
         }
 
         // Index available
+        else if (fields !=null){
+            // Get fields
+            meta = index.getFields(id, fields);
+        }
         else {
             // Get fields
             meta = index.getFields(id);
-        };
-
-        String availability = meta.getFieldValue("availability");
-        checkAvailability(licensePattern, availability, id);
+        }
+        
+        // EM: this approach forbids the whole metadata
+        // this should be refined by filtering out only the restricted
+        // metadata fields
+        // String availability = meta.getFieldValue("availability");
+        // checkAvailability(licensePattern, availability, id);
 
         return meta.toJsonString();
     };
+    
 
     public String getMatch (String id, List<String> foundries,
             List<String> layers, boolean includeSpans,
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java b/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
index f3299a8..13a89a1 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
@@ -224,7 +224,8 @@
     @Path("{version}/corpus/{corpusId}/{docId}/{textId}")
     public Response getMetadata (@PathParam("corpusId") String corpusId,
             @PathParam("docId") String docId,
-            @PathParam("textId") String textId, 
+            @PathParam("textId") String textId,
+            @QueryParam("fields") String fields,
             @Context SecurityContext ctx,
             @Context HttpHeaders headers
             // @QueryParam("fields") Set<String> fields
@@ -232,7 +233,7 @@
         TokenContext tokenContext = (TokenContext) ctx.getUserPrincipal();
         try {
             String results = searchService.retrieveDocMetadata(corpusId, docId,
-                    textId, tokenContext.getUsername(), headers);
+                    textId, fields, tokenContext.getUsername(), headers);
             return Response.ok(results).build();
         }
         catch (KustvaktException e) {
diff --git a/full/Changes b/full/Changes
index a1fd961..14a3e5e 100644
--- a/full/Changes
+++ b/full/Changes
@@ -10,7 +10,9 @@
    - Added metadata controller tests (margaretha)
 18/02/2019
    - Fixed tests (margaretha)
-   - Updated handling errors from Koral (margaretha)  
+   - Updated handling errors from Koral (margaretha)
+19/02/2019
+   - Added fields to metadata controller (margaretha, issue #39)
 
 # version 0.61.5
 17/12/2018
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
index 71a3fff..661cad1 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/MetadataControllerTest.java
@@ -3,6 +3,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -19,11 +20,41 @@
 public class MetadataControllerTest extends SpringJerseyTest {
 
     @Test
+    public void testRetrieveMetadataWithField () throws KustvaktException {
+        ClientResponse response = resource().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784")
+                .queryParam("fields", "author").get(ClientResponse.class);
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+
+        assertEquals("author", node.at("/document/fields/0/key").asText());
+    }
+    
+
+    @Test
+    public void testRetrieveMetadataWithMultipleFields () throws KustvaktException {
+        ClientResponse response = resource().path(API_VERSION).path("corpus")
+                .path("GOE").path("AGA").path("01784")
+                .queryParam("fields", "author,title").get(ClientResponse.class);
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+
+        assertEquals("author", node.at("/document/fields/0/key").asText());
+        assertEquals("title", node.at("/document/fields/1/key").asText());
+    }    
+    
+    @Test
     public void testFreeMetadata () throws KustvaktException {
 
         ClientResponse response = resource().path(API_VERSION).path("corpus")
                 .path("GOE").path("AGA").path("01784")
-                .queryParam("foundry", "*").get(ClientResponse.class);
+                .get(ClientResponse.class);
 
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
                 response.getStatus());
@@ -34,12 +65,14 @@
 
     }
 
+    // EM: currently all metadata are allowed
     @Test
+    @Ignore
     public void testMetadataUnauthorized () throws KustvaktException {
 
         ClientResponse response = resource().path(API_VERSION).path("corpus")
                 .path("GOE").path("AGI").path("04846")
-                .queryParam("foundry", "*").get(ClientResponse.class);
+                .get(ClientResponse.class);
 
         assertEquals(ClientResponse.Status.UNAUTHORIZED.getStatusCode(),
                 response.getStatus());
@@ -84,7 +117,9 @@
                 response.getStatus());
     }
 
+    // EM: currently all metadata are allowed
     @Test
+    @Ignore
     public void testMetadataAvailabilityAllUnauthorized ()
             throws KustvaktException {
         ClientResponse response = resource().path(API_VERSION).path("corpus")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
index fd33b90..0a62f9d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchControllerTest.java
@@ -23,12 +23,42 @@
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 /**
- * @author margaretha, hanl
- * @lastUpdate 22/03/2018
+ * @author hanl, margaretha
+ * @lastUpdate 18/02/2019
  *
  */
 public class SearchControllerTest extends SpringJerseyTest {
 
+    
+    private JsonNode requestSearchWithFields(String fields) throws KustvaktException{
+        ClientResponse response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
+                .queryParam("fields", fields)
+                .queryParam("context", "sentence").queryParam("count", "13")
+                .get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String query = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(query);
+        return node;
+    }
+    
+    @Test
+    public void testSearchWithField () throws KustvaktException {
+        JsonNode node = requestSearchWithFields("author");
+        assertNotEquals(0, node.at("/matches").size());
+        assertEquals("[\"author\"]",
+                node.at("/meta/fields").toString());
+    }
+    
+    @Test
+    public void testSearchWithMultipleFields () throws KustvaktException {
+        JsonNode node = requestSearchWithFields("author, title");
+        assertNotEquals(0, node.at("/matches").size());
+        assertEquals("[\"author\",\"title\"]",
+                node.at("/meta/fields").toString());
+    }
+    
     @Test
     public void testSearchQueryPublicCorpora () throws KustvaktException {
         ClientResponse response = resource().path(API_VERSION).path("search")
