-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
131 lines (99 loc) · 3.55 KB
/
Copy pathjustfile
File metadata and controls
131 lines (99 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Quickwit Tutorial Justfile
# Run `just --list` to see available commands
set dotenv-load := true
# Default recipe - show help
default:
@just --list
# ===== Docker Commands =====
# Start Quickwit server
up:
mkdir -p qwdata config
docker compose up -d
# Stop Quickwit server
down:
docker compose down
# View Quickwit logs
logs:
docker compose logs -f quickwit
# Restart Quickwit server
restart:
docker compose restart
# Remove all containers and volumes
clean:
docker compose down -v
rm -rf qwdata
# ===== Tutorial Commands =====
# Run the complete quickstart tutorial
tutorial: setup-index ingest search
@echo "✅ Tutorial completed! Visit http://localhost:7280 for the UI"
# Download the stackoverflow index config
download-config:
curl -o config/stackoverflow-index-config.yaml \
https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/stackoverflow/index-config.yaml
# Download the sample dataset
download-data:
curl -O https://quickwit-datasets-public.s3.amazonaws.com/stackoverflow.posts.transformed-10000.json
# Create the stackoverflow index
create-index:
docker compose exec quickwit quickwit index create \
--index-config /quickwit/config/stackoverflow-index-config.yaml
# Setup: download config and create index
setup-index: download-config create-index
# Ingest the sample data
ingest: download-data
docker compose cp stackoverflow.posts.transformed-10000.json quickwit:/quickwit/
docker compose exec quickwit quickwit index ingest \
--index stackoverflow \
--input-path /quickwit/stackoverflow.posts.transformed-10000.json \
--force
# Run a sample search query
search:
@echo "🔍 Searching for 'search AND engine'..."
curl -s "http://localhost:7280/api/v1/stackoverflow/search?query=search+AND+engine" | jq .
# Search with custom query
search-query query:
curl -s "http://localhost:7280/api/v1/stackoverflow/search?query={{query}}" | jq .
# Get aggregation of popular tags
search-tags:
curl -s -XPOST "http://localhost:7280/api/v1/stackoverflow/search" \
-H 'Content-Type: application/json' \
-d '{"query": "type:question", "max_hits": 0, "aggs": {"popular_tags": {"terms": {"field": "tags", "size": 10}}}}' | jq .
# Delete the stackoverflow index
delete-index:
docker compose exec quickwit quickwit index delete --index stackoverflow
# ===== Utility Commands =====
# Check Quickwit version
version:
curl -s http://localhost:7280/api/v1/version | jq .
# Check Quickwit health
health:
curl -s http://localhost:7280/health/livez
# List all indexes
list-indexes:
curl -s http://localhost:7280/api/v1/indexes | jq .
# Open Quickwit UI in browser
ui:
open http://localhost:7280
# ===== Rust CLI Commands =====
# For more CLI commands, run: just -f quickwit-cli/justfile --list
# Build the Rust CLI client
cli-build:
just -f quickwit-cli/justfile build-release
# Run CLI checks (format, clippy, test)
cli-check:
just -f quickwit-cli/justfile check
# List indexes using CLI
cli-indexes:
just -f quickwit-cli/justfile indexes
# Get index info using CLI
cli-index-info index="stackoverflow":
just -f quickwit-cli/justfile index-info {{index}}
# Search using CLI
cli-search query index="stackoverflow" max-hits="10":
just -f quickwit-cli/justfile search "{{query}}" {{index}} {{max-hits}}
# Search with JSON output
cli-search-json query index="stackoverflow":
just -f quickwit-cli/justfile search-json "{{query}}" {{index}}
# Check version using CLI
cli-version:
just -f quickwit-cli/justfile version