go fist
1.0.0
Golang Client для взаимодействия с FIST, минималистским полнотекстовым сервером поиска индекса с акцентом на сохранение простых вещей
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 ) // [] Более подробные примеры можно найти в подпакете ./examples
Каждый раз, когда должна быть выпущена новая версия для сервера, так и клиент, чтобы сохранить прямую и простую для следования зеркалированию версии клиента/сервера.
Выпущено в соответствии с условиями лицензии MIT. Обратитесь к лицензии для получения более подробной информации.