]> git.plutz.net Git - rigidfind/commitdiff
remove lengthy json responses that are never queried
authorPaul Hänsch <paul@plutz.net>
Tue, 5 Mar 2024 15:37:11 +0000 (16:37 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 5 Mar 2024 15:37:11 +0000 (16:37 +0100)
index.cgi

index 5351b2b27e3d42ed17a4124b79647b2c78e294ad..68d0ef2c21d126b8d8e1d5c08a5d8a4368b53455 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -263,66 +263,14 @@ elif [ "$REQUEST_METHOD" = "HEAD" ]; then
        EOF
   exit 0
 
-elif [ "$REQUEST_METHOD" = "GET" ]; then
-  accept="$(HEADER Accept)"
-  [ ! "${accept#*"vnd.elasticsearch+json"*}" ] \
-  && ctype="${accept}" || ctype="application/json"
-
+else
+  # elif [ "$REQUEST_METHOD" = "GET" ]; then
   cat <<-EOF
-       Status: 200 OK\r
+       Status: 501 Not Implemented\r
        X-elastic-product: Elasticsearch\r
-       content-type: ${ctype}\r
+       content-type: text/plain\r
        \r
+       Use the Nextcloud Elastic Search Plugin to use this service.
        EOF
-       
-  if [ "$PATH_INFO" = "/${_INDEX}/" ]; then
-  cat <<-EOF
-       { $(json_dump str:"${_INDEX}"): {
-           "aliases":{},
-           "mappings": {
-             "properties": {
-               "content": {"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "hash":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "metatags":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "owner":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "parts":{"properties":{"comments":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},
-               "provider":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "share_names":{"properties":{"paul":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},
-               "source":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},
-               "title":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}
-             }
-           },
-           "settings": {
-             "index": {
-               "routing":{"allocation":{"include":{"_tier_preference":"data_content"}}},
-               "number_of_shards":"1",
-               "provided_name": $(json_dump str:"${_INDEX}"),
-               "creation_date": "$(stat -c %W "${_DATA}/${_INDEX}")",
-               "number_of_replicas":"1",
-               "uuid":"0000000000000000000000",
-               "version":{"created":"8500010"}
-             }
-           }
-         }
-       }
-       EOF
-  else
-    cat <<-EOF
-       { "name" : "head",
-         "cluster_name" : "elasticsearch",
-         "version" : {
-           "number" : "8.12.1",
-           "lucene_version" : "9.9.2",
-           "minimum_wire_compatibility_version" : "7.17.0",
-           "minimum_index_compatibility_version" : "7.0.0"
-         },
-         "tagline" : "You Know, for Search"
-       }
-       EOF
-  fi
-  exit 0
-
-else
-  printf '%s\r\n' "Status: 500 Internal Server Error" ""
   exit 0
 fi