Before running Quickwit search instances on your servers, you will need to create indexes, add documents finally launch the server. In this quick start guide, we will install Quickwit and pass through these steps one by one. All Quickwit commands used in this guide are documented in the CLI reference documentation.
Let's download and install Quickwit.
This script will automatically pick the correct binary for your environment and then download and unpack it in your working directory. Once it is here, let's check if it is working!
You can now move this executable wherever sensible for your environment. (e.g.
You can also install it via other means.
Before adding documents to Quickwit, you need to create an index configured with a JSON
config file. This config file notably lets you define how to map your input documents to your index fields and whether these fields should be stored and indexed. See the index config documentation.
Let's create an index configured to receive Wikipedia articles.
The index config defines three text fields:
url. It also sets two default search fields
title. These fields will be used for search if you do not target a specific field in your query. Please note that by default, text fields are indexed and tokenized.
And here is the complete config:
Now we can create the index with the command:
To simplify our command, we now assume that the index is to be created in the current directory and use
pwd variable to specify the index uri:
Check that an empty directory
/$(pwd)/wikipedia has been created, Quickwit will write index files here and a
quickwit.json which contains the index metadata.
You're now ready to fill the index.
Behind the scenes, Quickwit will parse the index-uri and use the last part to infer your
index name. In the example above, our index name is Wikipedia. This
index name will be useful when using the search REST API.
Wait one second or two and check if it worked by using
It should return 10 hits. Now you're ready to serve our search API.
serve starts an http server which provides a REST API.
Check it's working with a simple GET request in the browser or via cURL:
You can also specify the search field with
body:barack AND obbama:
Check out the server logs to see what's happening.
The REST API use
index name which is defined by the last segment of your
Don't forget to encode correctly the query params to avoid bad request (status 400).
Let's do some cleanup by deleting the index:
Congrats! You can level up with the following tutorials to discover all Quickwit features.