Create Workload Guide

This guide explains how to create a Solr Orbit workload.

Option 1: Write a workload from scratch

A workload is a JSON file with the following structure:

{
  "name": "my-workload",
  "description": "Benchmark description",
  "collections": [
    {
      "name": "my-collection",
      "configset": "my-configset",
      "configset-path": "/path/to/configset/dir",
      "num-shards": 1,
      "replication-factor": 1
    }
  ],
  "challenges": [
    {
      "name": "default",
      "description": "Default challenge",
      "schedule": [
        {"operation": {"operation-type": "delete-collection", "ignore-missing": true}},
        {"operation": {"operation-type": "create-collection"}},
        {"operation": {"operation-type": "bulk-index", "bulk-size": 500}},
        {"operation": {"operation-type": "search", "q": "*:*", "rows": 10}},
        {"operation": {"operation-type": "optimize"}},
        {"operation": {"operation-type": "delete-collection"}}
      ]
    }
  ]
}

Run the workload with:

solr-orbit run \
  --pipeline=benchmark-only \
  --workload-path=/path/to/workload.json \
  --target-host="localhost:8983"

Option 2: Migrate an existing OSB workload

If you have a workload written for OpenSearch Benchmark, use the migration utility to translate it to Solr format:

solr-orbit convert-workload \
  --input osb-workload.json \
  --output solr-workload.json

The tool will:

  • Rename indicescollections
  • Translate bulkbulk-index, force-mergeoptimize, create-indexcreate-collection, delete-indexdelete-collection
  • Rename the index operation parameter → collection
  • Mark unsupported operations with a _migration_todo note — no operation is ever silently dropped

Review the output file and resolve any _migration_todo items before running.

Supported operation types

Operation typeDescription
bulk-indexIndex documents from an NDJSON corpus
searchRun a Solr query (classic params or JSON DSL body)
commitIssue a hard or soft commit
optimizeMerge segments
create-collectionUpload configset then create collection
delete-collectionDelete collection (and optionally its configset)
raw-requestIssue an arbitrary Solr V2 API request

Corpus format

Document corpora use NDJSON (newline-delimited JSON), with alternating action and document lines — the same format as OpenSearch/Elasticsearch bulk API:

{"index": {"_id": "1", "_index": "my-collection"}}
{"title": "Hello world", "body": "..."}
{"index": {"_id": "2"}}
{"title": "Second doc", "body": "..."}

The _id field is mapped to Solr's id field. _index and _type are used for routing/logging only and are not stored in the document.

Custom queries

For search operations using Solr's JSON Query DSL, pass a body dict:

{
  "operation-type": "search",
  "body": {
    "query": {"field": {"title": "hello"}},
    "limit": 10
  }
}

For classic Solr query syntax, use q, fl, rows, fq, and sort parameters directly:

{
  "operation-type": "search",
  "q": "title:hello",
  "rows": 10,
  "fl": "id,title,score"
}