Golang client to interact with Fist, a minimalist full-text index search server with a focus on keeping things simple
go get -u github.com/sonirico/go-fist
import fistClient "github.com/sonirico/go-fist"
// ...
client, err := fistClient.NewFistClient("localhost", "5575")
if err != nil {
fmt.Println("Connection Error! Is Fist up and running?")
return
}
// Obtain server version
version, _ := client.Version()
fmt.Println("Server version is " + version)
// Index some data
client.Index("articles", "a an the")
client.Index("TODO", "wash the car")
client.Index("TODO", "walk the dog")
client.Index("podcasts", "DSE - Daily software engineering")
// Search for "the" keyword
documents := client.Search("the")
fmt.Println(documents) // ["articles", "TODO"]
// Not needing articles?
client.Delete("the")
documents = client.Search("the")
fmt.Println(documents) // []
More detailed examples can be found under the ./examples
subpackage
Every time a new version for the server shall be released, so will the client so as to keep a direct and easy to follow client/server version mirroring
Released under the terms of the MIT license. Refer to LICENSE for more details.