diff --git a/api/handlers/dataexplorerhandler.py b/api/handlers/dataexplorerhandler.py
index 75aff09fe9af79ed15ea773e31c4d14a5c167ad1..bd084c70fb48de1ac6eee1371064d6bc4984b92a 100644
--- a/api/handlers/dataexplorerhandler.py
+++ b/api/handlers/dataexplorerhandler.py
@@ -47,7 +47,7 @@ BASE_QUERY = {
   }
 }
 
-FACET_QUERY = {
+OLD_FACET_QUERY = {
     "size": 0,
     "aggs" : {
         "Series Description" : {
@@ -90,6 +90,67 @@ FACET_QUERY = {
 }
 
 
+FACET_QUERY = {
+    "size": 0,
+    "aggs" : {
+        "subect.sex" : {
+            "terms" : {
+                "field" : "subect.sex.raw",
+                "size" : 15
+            }
+        },
+        "subject.code" : {
+            "terms" : {
+                "field" : "subject.code.raw",
+                "size" : 15
+            }
+        },
+        "session.tags" : {
+            "terms" : {
+                "field" : "session.tags.raw",
+                "size" : 15
+            }
+        },
+        "project.label" : {
+            "terms" : {
+                "field" : "project.label.raw",
+                "size" : 15
+            }
+        },
+        "file.measurements" : {
+            "terms" : {
+                "field" : "file.measurements.raw",
+                "size" : 15
+            }
+        },
+        "file.type" : {
+            "terms" : {
+                "field" : "file.type.raw",
+                "size" : 15
+            }
+        },
+        "session.timestamp" : {
+            "date_histogram" : {
+                "field" : "session.timestamp",
+                "interval" : "month"
+            }
+        },
+        "session.created" : {
+            "date_histogram" : {
+                "field" : "session.created",
+                "interval" : "month"
+            }
+        },
+        "subject.age" : {
+            "histogram" : {
+                "field" : "subject.age",
+                "interval" : 31556952
+            }
+        }
+    }
+}
+
+
 class DataExplorerHandler(base.RequestHandler):
 
     def __init__(self, request=None, response=None):
diff --git a/bin/dicom_doctype.py b/bin/dicom_doctype.py
index 16a9c2c02b295e988b115f0c511ae3a9a66f27ff..665151bbacc8c823005f58002121f31974b5f796 100755
--- a/bin/dicom_doctype.py
+++ b/bin/dicom_doctype.py
@@ -44,7 +44,7 @@ DYNAMIC_TEMPLATES = [
                 'match': '_id',
                 'match_mapping_type' : 'string',
                 'mapping': {
-                   'type': 'string',
+                   'type': 'text',
                    'index': 'not_analyzed'
                 }
             }
@@ -102,7 +102,7 @@ DYNAMIC_TEMPLATES = [
                 'match': 'hash',
                 'match_mapping_type' : 'string',
                 'mapping': {
-                   'type': 'string',
+                   'type': 'text',
                    'index': 'not_analyzed'
                 }
             }
@@ -112,13 +112,13 @@ DYNAMIC_TEMPLATES = [
                 'match': '*',
                 'match_mapping_type' : 'string',
                 'mapping' : {
-                    'type': 'string',
+                    'type': 'text',
                     'search_analyzer': 'str_search_analyzer',
                     'index_analyzer': 'str_index_analyzer',
                     'ignore_above': 10922,
                     "fields": {
                         "raw": {
-                            "type": "string",
+                            "type": "text",
                             "index": "not_analyzed",
                             "ignore_above": 256
                         }