Skip to main content
Version: main branch


In this tutorial, we will describe how to set up Quickwit to ingest data from Pulsar in a few minutes. First, we will create an index and configure a Pulsar source. Then, we will create a Pulsar topic and load some events from the Stack Overflow dataset into it. Finally, we will execute some searches.


You will need the following to complete this tutorial:

Quickwit setup

Download Quickwit and start a server. Then open a new terminal to execute CLI commands with the same binary.

./quickwit run

Test that the cluster is running:

./quickwit index list

Pulsar setup

tar xvfz apache-pulsar-2.11.0-bin.tar.gz
cd apache-pulsar-2.11.0
bin/pulsar standalone

Prepare Quickwit

First, let's create a new index. Here is the index config and doc mapping corresponding to the schema of Stack Overflow posts:

# Index config file for Stack Overflow dataset.
version: 0.6

index_id: stackoverflow

- name: user
type: text
fast: true
tokenizer: raw
- name: tags
type: array<text>
fast: true
tokenizer: raw
- name: type
type: text
fast: true
tokenizer: raw
- name: title
type: text
tokenizer: default
record: position
stored: true
- name: body
type: text
tokenizer: default
record: position
stored: true
- name: questionId
type: u64
- name: answerId
type: u64
- name: acceptedAnswerId
type: u64
- name: creationDate
type: datetime
fast: true
- rfc3339
precision: seconds
timestamp_field: creationDate

default_search_fields: [title, body]

commit_timeout_secs: 10

Execute these Bash commands to download the index config and create the stackoverflow index.

# Download stackoverflow index config.
wget -O stackoverflow.yaml

# Create index.
./quickwit index create --index-config stackoverflow.yaml

Create the Pulsar source

A Pulsar source just needs to define the list of topics and the instance address.

# Pulsar source config file.
version: 0.6
source_id: pulsar-source
source_type: pulsar
- stackoverflow
address: pulsar://localhost:6650

Run these commands to download the source config file and create the source.

# Download Pulsar source config.
wget -O stackoverflow-pulsar-source.yaml

# Create source.
./quickwit source create --index stackoverflow --source-config stackoverflow-pulsar-source.yaml

As soon as the Pulsar source is created, Quickwit control plane will ask an indexer to start a new indexing pipeline. You will see logs like below by looking on the indexer:

INFO spawn_pipeline{index=stackoverflow gen=0}:pulsar-consumer{subscription_name="quickwit-stackoverflow-pulsar-source" params=PulsarSourceParams { topics: ["stackoverflow"], address: "pulsar://localhost:6650", consumer_name: "quickwit", authentication: None } current_positions={}}: quickwit_indexing::source::pulsar_source: Seeking to last checkpoint positions. positions={}

Create and populate a Pulsar topic

We will use the Pulsar's default tenant/namespace public/default. To populate the topic, we will use a python script:
import json
import pulsar

client = pulsar.Client('pulsar://localhost:6650')
producer = client.create_producer('public/default/stackoverflow')

with open('stackoverflow.posts.transformed-10000.json', encoding='utf8') as file:
for i, line in enumerate(file):
if i % 100 == 0:
print(f"{i}/10000 messages sent.", i)


Install locally the python client, more details on documentation page:

# Download the first 10_000 Stackoverflow posts articles.
curl -O

# Install pulsar python client.
# Requires a python version < 3.11
pip3 install 'pulsar-client==2.10.1'

You can run this command to inspect the properties of the index and check the current number of published splits and documents:

# Display some general information about the index.
./quickwit index describe --index stackoverflow

You will notably see the number of published documents.

You are now ready to execute some queries.

curl 'http://localhost:7280/api/v1/stackoverflow/search?query=search+AND+engine'

If your Quickwit server is local, you can access to the results through Quickwit UI on localhost:7280.

Tear down resources (optional)

Let's delete the files and resources created for the purpose of this tutorial.

# Delete quickwit index.
./quickwit index delete --index stackoverflow --yes
# Delete Pulsar topic.
bin/pulsar-admin topics delete stackoverflow

This concludes the tutorial. If you have any questions regarding Quickwit or encounter any issues, don't hesitate to ask a question or open an issue on GitHub or contact us directly on Discord.