Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

REST structure #5

Closed
fils opened this issue Jun 22, 2018 · 3 comments
Closed

REST structure #5

fils opened this issue Jun 22, 2018 · 3 comments

Comments

@fils
Copy link

fils commented Jun 22, 2018

So I want to load into Blast using my own go RESTful client code.

In your example

$ cat ./example/document_1.json | xargs -0 ./bin/blast put document --request

I see we are doing a PUT to 0.0.0.0:8000/rest/ID where ID is the ID of the document.

However, how is the JSON document sent in that PUT command? Is this a BODY only or is there an association that needs to take place. I have used the HTTPie package with

http -v -j PUT 0.0.0.0:8000/rest/1 @sodataset.json

but it comes back 400 bad request. If we are using HTTPie or curl what would a PUT command look like?

I'm trying to load 50K JSON-LD documents (schema.org) from Minio into Blast.

Thanks!
Doug

@fils
Copy link
Author

fils commented Jun 26, 2018

I think I may have figured it out looking at the source...

I didn't realize the JSON needed to be wrapped in "document" like in

{
	"document" : {
    "fields": {
        "category": "Library",
        "description": "Bleve is a full-text search and indexing library for Go.",
        "name": "Bleve",
        "popularity": 3.0,
        "release": "2014-04-18T00:00:00Z",
        "type": "document"
    },
    "id": "1"
	}
}

@mosuka
Copy link
Owner

mosuka commented Aug 4, 2018

@fils
Sorry for the late reply. I was working on recreate Blast. I committed new code, please try v0.1.0 if you have time.

@mosuka
Copy link
Owner

mosuka commented Sep 13, 2018

Hi @fils

I close this issue. If you haven't resolve, please reopen this issue or create new issue.
Thank you for your report!

@mosuka mosuka closed this as completed Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants