field:* returns 0 hits when index built with index_field_presence: false

Offen
#6,475 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Ruhig
Tech-Stack
rust
Bereich
backend, search

Rechercherichtung

Beginne damit nachzuverfolgen, wie die Search API eine einfache field:*-Abfrage parst und wie dieser Pfad den Feldvorhandenseinsindex verwendet, wenn index_field_presence: false gesetzt ist. Vergleiche dies mit dem funktionierenden Workaround field:[* TO *] und ermittle anschließend, welche Existenzsemantik und welches Fehlerverhalten durch Tests abgedeckt werden sollten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:doc-mapping area:query

Summary

A bare field:* is parsed as the field-presence query, which is backed by the field-presence index. When an index has index_field_presence: false in its doc-mapping, every field:* returns 0 hits regardless of whether the column contains data. The failure is silent — no error, no warning — and is a frequent foot-gun for callers who reasonably read field:* as "field exists."

Repro

# doc-mapping.yaml
index_field_presence: false
field_mappings:
  - name: vendor
    type: text
    tokenizer: raw_lowercase
# Index {"vendor": "aws"}, then:
curl -sS "$QW/api/v1/<index>/search?query=vendor:*"
# → hits: 0. The document and the value exist; the field-presence
#   index was never populated.

Expected behavior

At minimum one of:

  1. field:* transparently falls back to a column-index scan when index_field_presence: false.
  2. Quickwit emits a parse-time warning (or 400) when field:* is used against an index without field-presence enabled.
  3. A separate, discoverable query operator with "exists in column" semantics that does not depend on the field-presence index.

The range form field:[* TO *] empirically works as a workaround, but it isn't documented as an existence check and only works on a subset of field types.

Use case

Multi-tenant indexes where some tenants opt out of index_field_presence for write-throughput reasons. Today this means every exists-style query has to special-case the index config.

Version

Observed on 0.8.x.

Vorherrschende Sprache
Rust
Sterne
11.8k
Forks
628
Ø Merge
2 T. 22 Std.
Gemergte PRs (30 T.)
50

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus quickwit-oss/quickwit

Alle Issues in quickwit-oss/quickwit

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.