Closed stardiviner closed 6 years ago
@stardiviner what version of es-mode are you using? I am able to query with 管理 no problem, retrieving results.
Also, what coding system is the buffer currently using? (and what emacs version?)
master
branch source code)It might be related to being on emacs master rather than the emacs-26
branch (which is what I'm running). I'll build a snapshot of master and see if it fails there.
I wasn't able to reproduce this on either the master
or the emacs-26
branch with emacs -q
, if you do
emacs -q
And then
(add-to-list 'load-path "~/path/to/requests")
(add-to-list 'load-path "~/path/to/es-mode")
(require 'es-mode)
And then try it, does it reproduce?
After following your steps.
I got the following output in *Messages*
:
executing Es code block...
Mark set
Issuing GET against http://localhost:9200/accounts/person/_search [jq=nil, tablify=nil]
Contacting host: localhost:9200
url-http-create-request: Multibyte text in HTTP request: GET /accounts/person/_search HTTP/1.1
MIME-Version: 1.0
Connection: keep-alive
Extension: Security/Digest Security/SSL
Host: localhost:9200
Accept-encoding: gzip
Accept: */*
User-Agent: URL/Emacs Emacs/27.0.50 (X11; x86_64-pc-linux-gnu)
Content-Type: application/json; charset=UTF-8
Content-length: 57
{
"query": {"match": {"desc": "管理"}},
"size": 1
}
But does not get result after execute es src block. Here is a screenshot:
Ahh okay, I know what's going on here. I switched the regular es-mode client to use a different http client (requests) but the org-mode execution still uses url-retrieve-synchronously
because it needs to be synchronous. I haven't been able to find a way to get url-retrieve-synchronously
to work correctly with multibyte things, so I need to switch org-mode execution to a different http client.
maybe change to other functions that support multibyte string?
That is the plan, just have to figure out what that is :)
Check out this discusion https://github.com/magit/ghub/issues/12
I've looked into this before, I am doing the same thing in es-mode where I encode the buffer:
Still digging
Huzzah found it (thanks to a link from the link you posted), it turns out the HTTP verb must be encoded also. I've pushed a commit, so let me know if this doesn't fix it for you (I tested your example and it works for me now)
I do it like this:
Then reported error: