Searchgoose is simple distributed RESTful search engine supporting searching and indexing data. For Study purposes, mostly understanding the implementation details of how elasticearch is built, focusing on clustering distributed system and supporting full-text search using bleve. Searchgoose aims to provide fast and flexible data handling by solving the problems of the existing relational database, which is bothering tasks to search and divide string data. To solve this problem, this project uses a data structure called an inverted index that supports fast full-text searches. It also implements raft-like algorithm and quorum-based voting system for discovery and election service in clustering mode.
$ docker build . --rm --tag searchgoose:latest
$ make build
$ go run main.go -transport.port=8180 -http.port=8080
$ go run main.go -node.name=sg-node-01 -transport.port=8180 -http.port=8080
$ go run main.go -node.name=sg-node-02 -seed_hosts=127.0.0.1:8180 -transport.port=8179 -http.port=8081
$ go run main.go -node.name=sg-node-03 -seed_hosts=127.0.0.1:8180 -transport.port=8181 -http.port=8082
To try any of the below queries you can use the above example quries
PUT /test15
content-type: application/json
{
"settings": {
"number_of_shards": 3
},
"mappings": {
"properties": {
"field1": {
"type": "text"
}
}
}
}
PUT /test15/_doc/4
content-type: application/json
{
"field1": "test",
"field2": "test2"
}
POST /test15/_search
content-type: application/json
{
"size": 100,
"query": {
"match": {
"field1": "field test"
}
}
}
The above image describes Searchgoose test application using Guttenberg-Search.
The above image describes simplified interface for managing and monitoring Searchgoose clusters by elasticsearch-HQ.