Ingestion de données dans Quickwit, moteur de recherche distribué écrit en Rust

API d'ingestion

Utilisez l'API d'ingesiton pour envoyer des données à Quickwit. Un serveur local doit être actif :

# Fichier de configuration d'index sans schéma
cat > config-index-dynamique.yaml << 'CONFIG'
version: 0.7
index_id: donnees-dynamiques
doc_mapping:
  mode: dynamic
indexing_settings:
  commit_timeout_secs: 30
CONFIG

# Création d'index via CLI
./quickwit index create --index-config config-index-dynamique.yaml

# Alternative avec cURL
curl -XPOST -H 'Content-Type: application/yaml' 'http://localhost:7280/api/v1/indexes' --data-binary @config-index-dynamique.yaml

Chargement des données

# Téléchargement du dataset
wget https://storage.exemple.com/dataset-echantillon.json

# Ingestion via CLI
./quickwit index ingest --index donnees-dynamiques --input-path dataset-echantillon.json --force

# Requête de recherche
curl 'http://localhost:7280/api/v1/donnees-dynamiques/search?query=contenu:python'

Fichiers locaux

# Création d'index
./quickwit index create --index-config config-fichiers.yaml

# Ingestion locale
./quickwit tool local-ingest --index donnees-locales --input-path local-data.json

# Sortie typique
Indexé 15 000 documents en 5s.

Intégration Kafka

# Configuration d'index pour événements
field_mappings:
  - name: timestamp
    type: datetime
    fast: true
  - name: payload
    type: json

# Création de topic Kafka
kafka-topics.sh --create --topic flux-events --partitions 3

# Configuration de source
params:
  topic: flux-events
  client_params:
    bootstrap.servers: localhost:9092

# Surveillance d'index
./quickwit index describe --index evenements-kafka

Connexion Pulsar

# Configuration Pulsar
params:
  topics:
    - pulsar-topic
  address: pulsar://localhost:6650

# Script d'envoi Python
producer = client.create_producer('public/default/pulsar-topic')
with open('data.json') as f:
   for line in f:
       producer.send(line.encode())

Intégration Kinesis

# Création de flux
aws kinesis create-stream --stream-name flux-donnees --shard-count 8

# Configuration source
source_type: kinesis
params:
  stream_name: flux-donnees

# Requête agrégée
curl -XPOST 'http://localhost:7280/api/v1/archives/search' -d '{
  "aggs":{
    "comptage_par_type":{
      "terms":{"field":"categorie"}
    }
  }
}'

S3 avec notifications SQS

# Configuration Terraform
resource "aws_s3_bucket" "source" {
  bucket_prefix = "quickwit-source"
}

# Politique SQS
params:
  notifications:
    - type: sqs
      queue_url: https://sqs.region.amazonaws.com/queue-name
      message_type: s3_notification

# Téléversement de données
aws s3 cp dataset.json s3://quickwit-source/

Étiquettes: Quickwit Rust Indexation Kafka Pulsar

Publié le 12 juin à 21h05