Comment

Comment by byteshock

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...

parent byteshock 3 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton