Skip to content

Commit d3c9560

Browse files
authored
Add documents (#19)
1 parent 447da38 commit d3c9560

40 files changed

+7229
-221
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ docker-push:
3434

3535
docker-clean:
3636
docker rmi -f $(shell docker images --filter "dangling=true" -q --no-trunc)
37+
38+
build-docs:
39+
mdbook build

README.md

Lines changed: 3 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -16,225 +16,7 @@ Bayard makes easy for programmers to develop search applications with advanced f
1616
- Command line interface is available
1717

1818

19-
## Building Bayard
19+
## Documents
2020

21-
```text
22-
$ make build
23-
```
24-
25-
26-
## Starting in standalone mode (single node cluster)
27-
28-
Running node in standalone mode is easy. See following command:
29-
30-
```text
31-
$ ./bin/bayard serve
32-
```
33-
34-
### Indexing document
35-
36-
Indexing a document is as following:
37-
38-
```text
39-
$ ./bin/bayard set 1 '{"text":"Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust."}'
40-
$ ./bin/bayard set 2 '{"text":"Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java."}'
41-
$ ./bin/bayard set 3 '{"text":"Bleve is a modern text indexing library for go."}'
42-
$ ./bin/bayard set 4 '{"text":"Whoosh is a fast, pure Python search engine library."}'
43-
$ ./bin/bayard set 5 '{"text":"Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more."}'
44-
$ ./bin/bayard set 6 '{"text":"Elasticsearch is a distributed, open source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured."}'
45-
$ ./bin/bayard set 7 '{"text":"Riot is Go Open Source, Distributed, Simple and efficient full text search engine."}'
46-
$ ./bin/bayard set 8 '{"text":"Blast is a full text search and indexing server, written in Go, built on top of Bleve."}'
47-
$ ./bin/bayard set 9 '{"text":"Toshi is meant to be a full-text search engine similar to Elasticsearch. Toshi strives to be to Elasticsearch what Tantivy is to Lucene."}'
48-
$ ./bin/bayard set 10 '{"text":"Sonic is a fast, lightweight and schema-less search backend."}'
49-
$ ./bin/bayard set 11 '{"text":"Bayard is a full text search and indexing server, written in Rust, built on top of Tantivy."}'
50-
```
51-
52-
### Getting document
53-
54-
Getting a document is as following:
55-
56-
```text
57-
$ ./bin/bayard get 11 | jq .
58-
```
59-
60-
You can see the result in JSON format. The result of the above command is:
61-
62-
```json
63-
{
64-
"id": [
65-
"11"
66-
],
67-
"text": [
68-
"Bayard is a full text search and indexing server, written in Rust, built on top of Tantivy."
69-
]
70-
}
71-
```
72-
73-
### Searching documents
74-
75-
Searching documents is as like following:
76-
77-
```
78-
$ ./bin/bayard search text:"search engine" | jq .
79-
```
80-
81-
You can see the result in JSON format. The result of the above command is:
82-
83-
```json
84-
[
85-
{
86-
"id": [
87-
"4"
88-
],
89-
"text": [
90-
"Whoosh is a fast, pure Python search engine library."
91-
]
92-
},
93-
{
94-
"id": [
95-
"7"
96-
],
97-
"text": [
98-
"Riot is Go Open Source, Distributed, Simple and efficient full text search engine."
99-
]
100-
},
101-
{
102-
"id": [
103-
"1"
104-
],
105-
"text": [
106-
"Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust."
107-
]
108-
},
109-
{
110-
"id": [
111-
"2"
112-
],
113-
"text": [
114-
"Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java."
115-
]
116-
},
117-
{
118-
"id": [
119-
"6"
120-
],
121-
"text": [
122-
"Elasticsearch is a distributed, open source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured."
123-
]
124-
},
125-
{
126-
"id": [
127-
"9"
128-
],
129-
"text": [
130-
"Toshi is meant to be a full-text search engine similar to Elasticsearch. Toshi strives to be to Elasticsearch what Tantivy is to Lucene."
131-
]
132-
},
133-
{
134-
"id": [
135-
"10"
136-
],
137-
"text": [
138-
"Sonic is a fast, lightweight and schema-less search backend."
139-
]
140-
},
141-
{
142-
"id": [
143-
"11"
144-
],
145-
"text": [
146-
"Bayard is a full text search and indexing server, written in Rust, built on top of Tantivy."
147-
]
148-
},
149-
{
150-
"id": [
151-
"8"
152-
],
153-
"text": [
154-
"Blast is a full text search and indexing server, written in Go, built on top of Bleve."
155-
]
156-
}
157-
]
158-
```
159-
160-
### Deleting document
161-
162-
```
163-
$ ./bin/bayard delete 11
164-
```
165-
166-
167-
## Starting in cluster mode (3-node cluster)
168-
169-
Bayard can easily bring up a cluster. Running in standalone is not fault tolerant. If you need to improve fault tolerance, start two more nodes as follows:
170-
171-
```
172-
$ ./bin/bayard serve \
173-
--host=0.0.0.0 \
174-
--port=5001 \
175-
--id=1 \
176-
--peers="1=0.0.0.0:5001" \
177-
--data-directory=./data/1 \
178-
--schema-file=./etc/schema.json \
179-
--unique-key-field-name=id
180-
181-
$ ./bin/bayard serve \
182-
--host=0.0.0.0 \
183-
--port=5002 \
184-
--id=2 \
185-
--peers="1=0.0.0.0:5001,2=0.0.0.0:5002" \
186-
--leader-id=1 \
187-
--data-directory=./data/2 \
188-
--schema-file=./etc/schema.json \
189-
--unique-key-field-name=id
190-
191-
$ ./bin/bayard serve \
192-
--host=0.0.0.0 \
193-
--port=5003 \
194-
--id=3 \
195-
--peers="1=0.0.0.0:5001,2=0.0.0.0:5002,3=0.0.0.0:5003" \
196-
--leader-id=1 \
197-
--data-directory=./data/3 \
198-
--schema-file=./etc/schema.json \
199-
--unique-key-field-name=id
200-
```
201-
202-
Above example shows each Bayard node running on the same host, so each node must listen on different ports. This would not be necessary if each node ran on a different host.
203-
Recommend 3 or more odd number of nodes in the cluster. In failure scenarios, data loss is inevitable, so avoid deploying single nodes.
204-
205-
### Remove a node from a cluster
206-
207-
If one of the nodes in a cluster goes down due to a hardware failure and raft logs and metadata is lost, that node cannot join the cluster again.
208-
209-
```
210-
$ ./bin/bayard leave \
211-
--host=127.0.0.1 \
212-
--port=5001 \
213-
--id=3 \
214-
--peers="1=0.0.0.0:5001,2=0.0.0.0:5002" \
215-
--leader-id=1
216-
```
217-
218-
219-
## Bayard on Docker
220-
221-
### Pulling Docker container image from docker.io
222-
223-
You can pull the Docker container image already registered in docker.io like so:
224-
225-
```
226-
$ docker pull bayardsearch/bayard:latest
227-
```
228-
229-
Check the available version at the following URL:
230-
https://hub.docker.com/r/bayardsearch/bayard/tags/
231-
232-
### Running Docker container
233-
234-
Running a Bayard on Docker like so:
235-
236-
```
237-
$ docker run --rm --name bayard \
238-
-p 5000:5000 \
239-
bayardsearch/bayard:latest serve
240-
```
21+
The document is available at the following URL:
22+
- [https://bayard-search.github.io/bayard/](https://bayard-search.github.io/bayard/)

book.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[book]
2+
authors = ["Minoru Osuka"]
3+
language = "en"
4+
multilingual = false
5+
src = "docs_src"
6+
title = "Bayard"
7+
8+
[build]
9+
build-dir = "docs"
10+
create-missing = false

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file makes sure that Github Pages doesn't process mdBook's output.

docs/FontAwesome/css/font-awesome.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
162 KB
Binary file not shown.
162 KB
Binary file not shown.

0 commit comments

Comments
 (0)