mosuka / blast

Blast is a full text search and indexing server, written in Go, built on top of Bleve.
Apache License 2.0
1.08k stars 76 forks source link

Error getting document by ID over rest API #123

Closed flaviostutz closed 4 years ago

flaviostutz commented 4 years ago

I get an error when issuing a very simple query over rest endpoint:

flaviostutz-Mac:fess flaviostutz$ curl -vv --location --request GET 'localhost:6000/v1/documents/a2b'
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 6000 (#0)
> GET /v1/documents/a2b HTTP/1.1
> Host: localhost:6000
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< Grpc-Metadata-Content-Type: application/grpc
< Grpc-Metadata-Content-Type: application/grpc
< Date: Fri, 17 Jan 2020 21:27:59 GMT
< Content-Length: 130
<
* Connection #0 to host localhost left intact
{"error":"unknown message type \"map[string]interface {}\"","code":2,"message":"unknown message type \"map[string]interface {}\""}* Closing connection 0

Seems like a Golang cast issue. I could not find the location this is handled on code. Anyone could help?

mosuka commented 4 years ago

Hi. What schema and document can reproduce the error?

flaviostutz commented 4 years ago

I defined no schema prior to “PUT” document. Maybe this is the cause. How do I create a “schema”? (All other functions are working regardless of not having a prior schema do the document)

Sent from my iPhone

On 19 Jan 2020, at 22:34, Minoru Osuka notifications@github.com wrote:

 Hi. What schema and document can reproduce the error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mosuka commented 4 years ago

@flaviostutz Sorry for the late reply.

Please refer to example schema : https://github.com/mosuka/blast/blob/master/example/wiki_index_mapping.json

Or, refer bleve-mapping-ui: https://github.com/blevesearch/bleve-mapping-ui