mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2025-12-23 02:29:57 +00:00
Added starting tutorial
This commit is contained in:
24
Cargo.toml
24
Cargo.toml
@@ -3,33 +3,42 @@ name = "tantivy"
|
||||
version = "0.1.0"
|
||||
authors = ["Paul Masurel <paul.masurel@gmail.com>"]
|
||||
build = "build.rs"
|
||||
license = "MIT"
|
||||
|
||||
description = """Tantivy is a search engine library."""
|
||||
|
||||
documentation = "http://fulmicoton.com/tantivy/tantivy/index.html"
|
||||
homepage = "https://github.com/fulmicoton/tantivy"
|
||||
repository = "https://github.com/fulmicoton/tantivy"
|
||||
|
||||
readme = "README.md"
|
||||
keywords = ["search", "information", "retrieval"]
|
||||
|
||||
[dependencies]
|
||||
byteorder = "0.4"
|
||||
memmap = "0.2"
|
||||
lazy_static = "0.1.*"
|
||||
lazy_static = "0.1.16"
|
||||
regex = "0.1"
|
||||
fst = "0.1.31"
|
||||
atomicwrites = "0.0.14"
|
||||
tempfile = "2.0.0"
|
||||
rustc-serialize = "0.3.16"
|
||||
log = "0.3.5"
|
||||
combine = "*"
|
||||
combine = "1.3.0"
|
||||
tempdir = "0.3.4"
|
||||
bincode = "0.4.0"
|
||||
libc = "0.2.6"
|
||||
argparse = "*"
|
||||
num_cpus = "0.2"
|
||||
itertools = "0.4.16"
|
||||
lz4 = "1.13.131"
|
||||
time = "0.1.34"
|
||||
uuid = "0.1"
|
||||
|
||||
iron = "0.4"
|
||||
staticfile = "0.3.0"
|
||||
persistent="*"
|
||||
ansi_term = "*"
|
||||
persistent="0.2.0"
|
||||
ansi_term = "0.8.0"
|
||||
clap = "2"
|
||||
mount = "0.2.1"
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.3.13"
|
||||
@@ -48,5 +57,4 @@ doc = false
|
||||
[dependencies.urlencoded]
|
||||
version = "0.4"
|
||||
|
||||
[dependencies.mount]
|
||||
git = "https://github.com/iron/mount.git"
|
||||
|
||||
|
||||
7
LICENSE
Normal file
7
LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2016 Paul Masurel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
43
docs/tutorial.md
Normal file
43
docs/tutorial.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Indexing Wikipedia with Tantivy CLI interface
|
||||
|
||||
## Introduction
|
||||
|
||||
In this tutorial, we will create a brand new index
|
||||
with the articles of English wikipedia in it.
|
||||
|
||||
|
||||
|
||||
## Step 1 - Get tantivy CLI interface
|
||||
|
||||
There are two ways to get `tantivy`.
|
||||
If you are a rust programmer, you can run `cargo install tantivy`.
|
||||
Alternatively, if you are on `Linux 64bits`, you can download a
|
||||
static binary here []()
|
||||
|
||||
## Step 2 - creating the index
|
||||
|
||||
Create a directory in which your index will be stored.
|
||||
|
||||
```bash
|
||||
# create the directory
|
||||
mkdir wikipedia-index
|
||||
```
|
||||
|
||||
|
||||
We will now initialize the index and create it's schema.
|
||||
|
||||
Our documents will contain
|
||||
* a title
|
||||
* a body
|
||||
* a url
|
||||
|
||||
Running
|
||||
|
||||
```bash
|
||||
# create the directory
|
||||
tantivy
|
||||
```
|
||||
|
||||
|
||||
|
||||
https://www.dropbox.com/s/wwnfnu441w1ec9p/wiki-articles.json.bz2?dl=0
|
||||
4
script/build-static-binary.sh
Normal file
4
script/build-static-binary.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
# the musl-tools package must be installed.
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
cargo build --release --target=x86_64-unknown-linux-musl
|
||||
|
||||
5
script/profile.sh
Normal file
5
script/profile.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#/bin/bash
|
||||
valgrind --tool=cachegrind target/release/tantivy-bench -i /data/wiki-index -q ./queries.txt -n 3
|
||||
valgrind --tool=callgrind target/release/tantivy-bench -i /data/wiki-index -q ./queries.txt -n 3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user