docsearch

command module
v0.0.0-...-5c72b2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

docsearch

Golang製の全文検索エンジンを利用したアプリケーションです。

日本語アナライザーにはkagomeを利用しています。

起動時にユーザー辞書を設定するか

APIで公開されているエンドポイントからユーザー辞書を登録して頂くことも可能です。

また、分散合意アルゴリズ(Raft)を利用してクラスターを構成することも可能です。

クラスターを組む際は奇数ノードを指定してください。

API

OpenAPI2(swagger)でご確認下さい。

Architecture

アプリケーションサーバー構成

+--client--+  +--------------------------------------------server---------------------------------------------+
|          |  |                                                                                               |
| +------+ |  | +--------------+                                                                              |
| |      | |  | |              |                                                                              |
| | REST -------> gRPC-Gateway -----+                                                                         |
| |      | |  | |              |    |                                                                         |
| +------+ |  | +--------------+    |   +-------------+   +-------------+   +---------+   +-------+           |
| |      | |  |                     |   |             |   |             |   |         |   |       |           |
| | gRPC ---------------------------+---> gRPC-server |---> Raft server |---> storage |---> bluge |           |
| |      | |  |                         |             |   |             |   |         |   |       |           |
| +------+ |  |                         +-------------+   +-------------+   +---------+   +-------+           |
|          |  |                                                                                               |
+----------+  +-----------------------------------------------------------------------------------------------+

クラスタリング構成(Raft)

                         +-----------+
                         |           |
              +-----------> Follower |
              |          |           |
+--------+    |          +-----------+
|        |    |
| Leader -----+
|        |    |
+--------+    |           +----------+
              |           |          |
              +-----------> Follower |
                          |          |
                          +----------+

Arguments

start
引数 内容
id ノードID(default: node1)
raft-address raft serverのIPアドレスorホスト名:ポート番号(default: 127.0.0.1:7000)
grpc-address grpc serverのIPアドレスorホスト名:ポート番号(default: 127.0.0.1:8000)
http-address grpc-gateway(http server)のIPアドレスorホスト名:ポート番号(default: 127.0.0.1:9000)
data-directory アプリケーション情報を保存するディレクトリパス(default: data/docsearch)
peer-grpc-address クラスターを組む際の接続先アドレス(bootstrapサーバー)
certificate-file 証明書ファイル
key-file 秘密鍵ファイル
common-name コモンネーム
log-file ログファイル(default: /dev/stdout)
log-level ログレベル(default: DEBUG)
log-format ログ出力フォーマット(default: json)
user-dictionary ユーザー辞書ファイル
Raft(分散合意アルゴリズム)

gRPC

go install \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
    google.golang.org/protobuf/cmd/protoc-gen-go \
    google.golang.org/grpc/cmd/protoc-gen-go-grpc \
    github.com/envoyproxy/protoc-gen-validate

make protoc

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
client module
metric
plugin
protobuf module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL