Hacker News new | ask | show | jobs
by byteshock 1098 days ago
For the query string, you don’t have to implement your own DSL. Elasticsearch supports it out of the box. You could POST a JSON object to “/_search” but you can also do a GET with the “q” query parameter. Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/curr...

In the Golang library you can use the “Search.WithQuery” option. This means you don’t have to construct a JSON request body.

Here’s an example: https://github.com/taythebot/archer/blob/main/pkg/elasticsea...