debugModeratepending
Elasticsearch query returns no results despite data existing
Viewed 0 times
no resultsanalyzedkeywordmappingterm vs matchrefresh
elasticsearch
Error Messages
Problem
Documents are indexed but search returns zero results. The data is visible in Kibana but the query returns nothing. Exact match queries fail on text fields.
Solution
Common causes: (1) Analyzed vs keyword fields: text fields are analyzed (tokenized, lowercased). Use .keyword subfield for exact match. (2) Mapping mismatch: field mapped as text but queried as keyword or vice versa. Check mapping: GET /index/_mapping. (3) Index not refreshed: ES is near-realtime. Force refresh: POST /index/_refresh. (4) Query syntax: match vs term. Use match for analyzed text, term for exact keyword values. (5) Default operator is OR, not AND. Use match with operator: and.
Why
Elasticsearch analyzes text fields during indexing (splitting, lowercasing, stemming). Queries must match the analyzed form, not the original text.
Revisions (0)
No revisions yet.