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

An in-memory Indexer implementation using bleve

Our first attempt at implementing an in-memory indexer will be based on a popular full-text search package for Go called bleve [1]. While bleve is primarily designed to store its index on disk, it also supports an in-memory index. This makes it an excellent candidate for running unit tests in isolation or for demonstration purposes if we don't want to spin up a much more resource-intensive option such as Elasticsearch.

The full source for the bleve-based Indexer implementation is available in the Chapter06/textindexer/store/memory package in this book's GitHub repository. The definition of the InMemoryBleveIndexer type is pretty straightforward:

type InMemoryBleveIndexer struct { mu sync.RWMutex ...
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