Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andyatkinson/search-api-service


https://github.com/andyatkinson/search-api-service

elasticsearch golang

Last synced: 13 days ago
JSON representation

Awesome Lists containing this project

README

        

## Search API

Copied from source article:

```
Upload a couple of fake documents, for example, documents found inside fake-data.json file.

$ curl -X POST http://localhost:8080/documents -d @fake-data.json -H "Content-Type: application/json"
Try it out.

$ curl http://localhost:8080/search?query=exercitation+est+officia
{
"time": "42",
"hits": "43",
"documents": [{
"title": "Exercitation est officia fugiat labore deserunt est id voluptate magna.",
"created_at": "2018-03-21T15:22:48.7830606Z",
"content": "..."
},
// ...
]
}
```

### Docker

#### Docker up

`docker-compose up -d --build`

```
-d # Detached mode
--build # Build images before starting containers
```

#### Stop container

`docker ps`
`docker stop search_api`
`docker stop elasticsearch`