File system pdf links open in browser

(from github.com/sgraham3)
I have some pdf documents indexed on the file system and when the link is selected the pdf is downloaded instead of opening in the browser. Is there a way tho have the pdf open in a new tab in the browser?

(from github.com/marevol)
Could you send the following request to elasticsearch(9200 or 9201)?
You can check mimetype and the correct value is “application/pdf”.

curl -XPOST localhost:9200/fess.search/_search -d '
{
  "query": {
    "bool": {
      "should": [
        {
          "term": {
            "filetype": {
              "value": "pdf"
            }
          }
        },
        {
          "wildcard": {
            "url": {
              "value": "*pdf"
            }
          }
        }
      ]
    }
  },
  "size": 0,
  "aggs": {
    "mimetype": {
      "terms": {
        "field": "mimetype",
        "size": 10
      }
    }
  }
}'

(from github.com/sgraham3)
{“error”:“Content-Type header [application/x-www-form-urlencoded] is not supported”,“status”:406}

(from github.com/marevol)
-H ‘Content-Type: application/json’

(from github.com/sgraham3)
Thanks marevol
unfortunately I am not a programmer or have much knowledge of Elasticsearch. From what I have read I came up with curl -XPUT localhost:9201/fess.20170713 -H ‘Content-Type: application/json’ -d ’ but it doesn’t work and I am not sure how to precede.

(from github.com/marevol)
I wanted to check if pdf files have a proper mimetype.

  1. Put the following content to test.req file
POST /fess.search/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "term": {
            "filetype": {
              "value": "pdf"
            }
          }
        },
        {
          "wildcard": {
            "url": {
              "value": "*pdf"
            }
          }
        }
      ]
    }
  },
  "size": 0,
  "aggs": {
    "mimetype": {
      "terms": {
        "field": "mimetype",
        "size": 10
      }
    }
  }
}
  1. Open http://127.0.0.1:8080/admin/esreq/ and then upload test.req
  2. Check es_*.json file

(from github.com/sgraham3)
{“took”:1102,“timed_out”:false,"_shards":{“total”:5,“successful”:5,“failed”:0},“hits”:{“total”:17881,“max_score”:0.0,“hits”:[]},“aggregations”:{“mimetype”:{“doc_count_error_upper_bound”:0,“sum_other_doc_count”:0,“buckets”:[{“key”:“application/pdf”,“doc_count”:17881}]}}}

(from github.com/marevol)
Thank you for checking it.
It seems that mimetype is correct.
I’ll fix it in next release.

(from github.com/sgraham3)
Thanks