bitemyapp / bloodhound

Haskell Elasticsearch client and query DSL
bitemyapp.com
BSD 3-Clause "New" or "Revised" License
424 stars 118 forks source link

BloodHound creates invalid url #179

Open flip111 opened 7 years ago

flip111 commented 7 years ago

I create the DocId by calculating a hash of the content, that way i will be able to search easily if a document was already added to the database. For the for document this goes fine, for the second an expection is thrown.

Processing: 3.pdf
Response {responseStatus = Status {statusCode = 201, statusMessage = "Created"}, responseVersion = HTTP/1.1, responseHeaders = [("Location","/volumes/document/7%C2%90%15i%C3%92%C2%8F%C2%B8%08%C3%B8_%C2%92%C2%AE%C3%8F%C3%91%C2%BE%C2%BC%3D%1A%C2%9D50xhW%EF%BF%BDiSk%C2%AE%C2%AB%C3%A5%C3%A8%C3%92%40%3AB%C2%BF%C3%90%C2%8F%C2%B8%29%C2%88%C2%8E%28w%03%C3%BC%C3%87A%15%C2%A22%3C%C2%B8%C2%8F%C3%85%C2%B6%C2%9F%C3%B6%13%C2%A9%0B"),("content-type","application/json; charset=UTF-8"),("content-encoding","gzip"),("transfer-encoding","chunked")], responseBody = "{\"_index\":\"volumes\",\"_type\":\"document\",\"_id\":\"7\194\144\\u0015i\195\146\194\143\194\184\\b\195\184_\194\146\194\174\195\143\195\145\194\190\194\188=\\u001A\194\157\&50xhW\239\191\189iSk\194\174\194\171\195\165\195\168\195\146@:B\194\191\195\144\194\143\194\184)\194\136\194\142(w\\u0003\195\188\195\135A\\u0015\194\162\&2<\194\184\194\143\195\133\194\182\194\159\195\182\\u0013\194\169\\u000B\",\"_version\":1,\"result\":\"created\",\"_shards\":{\"total\":3,\"successful\":1,\"failed\":0},\"created\":true}", responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}
complete

Processing: 2.pdf
*** Exception: InvalidUrlException "http://localhost:9200/volumes/document/%C2%A3%0B%C2%81p%7D%C2%AE%5C%C2%9E~%C2%8E%1B%C2%8B%C2%A4%C3%B6%C2%B0YZ%C3%A0%C2%AD%C2%B4%C3%9C%C3%BA%C3%BD%17%C2%90%1C%C2%94%C2%A2%0F%C3%A7D%1F%C3%AE%0CSAo%02hD%03a]%C3%BB%13%15%C3%BDa%C2%B6%120N%C3%87QAla'%C3%A5%C3%82%11z%C3%A8%C3%80" "Invalid URL"

by the way i choose decodeLatin1 to convert raw bytes into Text