Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Performing paginated searches

As you might expect from a product whose primary job is searching within documents, Elasticsearch supports a plethora of different query types, ranging from keyword-based searches to complex geospatial or time-based queries. Unfortunately, the syntax for specifying queries varies slightly, depending on the type of query that we wish to perform.

It turns out that, for our particular use case, we can get away with using the same query syntax for both keyword- and phrase-based queries. All we need to do is convert the QueryType provided by the caller into an Elasticsearch-specific value that we can plug into a predefined search template. To achieve this, the indexer implementation makes use of the switch block ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content