quickwit-oss / quickwit-oss/quickwit

Update the swagger documentation on the POST mapping and ingest data

Open
#4,188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
11.7k
Forks
597
Avg merge
2d 22h
Merged PRs (30d)
37

Description

Describe the bug

When we're using the Swagger tabs provided in the Quickwit UI:

Screenshot 2023-11-22 at 16 20 15

Steps to reproduce (if applicable)
Steps to reproduce the behavior:

  1. Go to the swagger ui
  2. Select the endpoint POST /api/v1/index
  3. Try it out, you'll get this endpoint body:
{
  "doc_mapping": {
    "dynamic_mapping": {
      "description": "string",
      "expand_dots": true,
      "fast": true,
      "indexed": true,
      "record": "basic",
      "stored": true,
      "tokenizer": "string"
    },
    "field_mappings": [
      {
        "name": "string",
        "type": "string",
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      }
    ],
    "max_num_partitions": 0,
    "mode": "lenient",
    "partition_key": "string",
    "store_source": true,
    "tag_fields": [
      "string"
    ],
    "timestamp_field": "string",
    "tokenizers": [
      {
        "type": "simple",
        "filters": [
          "remove_long"
        ],
        "name": "string"
      },
      {
        "max_gram": 0,
        "min_gram": 0,
        "prefix_only": true,
        "type": "ngram",
        "filters": [
          "remove_long"
        ],
        "name": "string"
      },
      {
        "pattern": "string",
        "type": "regex",
        "filters": [
          "remove_long"
        ],
        "name": "string"
      }
    ]
  },
  "index_id": "string",
  "index_uri": "string",
  "indexing_settings": {
    "commit_timeout_secs": 60,
    "docstore_blocksize": 1000000,
    "docstore_compression_level": 8,
    "merge_policy": {
      "type": "no_merge"
    },
    "resources": {
      "heap_size": "2 GB",
      "max_merge_write_throughput": "string"
    },
    "split_num_docs_target": 0
  },
  "retention": {
    "period": "string",
    "schedule": "string"
  },
  "search_settings": {
    "default_search_fields": [
      "string"
    ]
  },
  "version": "0.6"
}

Here's the errors:

  • Type string doesn't exists => text
  • Mode lenient : only the mode dynamic seems supported
  • The timestamp need to match with a field declared with a datetime type and fast set to true

Here's an example of working payload:

{
  "doc_mapping": {
    "dynamic_mapping": {
      "description": "the description",
      "expand_dots": true,
      "fast": true,
      "indexed": true,
      "record": "basic",
      "stored": true,
      "tokenizer": "raw"
    },
    "field_mappings": [
      {
        "name": "yo",
        "type": "text"
      },
      {
        "name": "timestamp",
        "type": "datetime",
        "fast": true
      }
    ],
    "max_num_partitions": 1,
    "mode": "dynamic",
    "partition_key": "yo",
    "store_source": true,
    "tag_fields": [],
    "timestamp_field": "timestamp"
  },
  "index_id": "yoi",
  "search_settings": {
    "default_search_fields": [
      "yo"
    ]
  },
  "version": "0.6"
}
  1. Go to the /api/v1/{index_id}/ingest

The Force in the ingest api seems not work (case sensitive ?)

Screenshot 2023-11-22 at 16 28 03

Expected behavior

The documentation payloads and fields needs to be up to date.

Configuration:

v0.6.2 on Kubernetes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the Swagger UI schemas for POST /api/v1/index and /api/v1/{index_id}/ingest, comparing their generated payloads with the working example and reported Force behavior. Update the documented field values and request examples so they match the API, then verify both endpoints in Swagger UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.