Loki indexes only the label sets and keeps log content compressed in object storage, so a text search first uses labels to pick streams and then brute-force scans just those chunks — which is why tight label selectors matter so much. There is no full-text index (that is the Elasticsearch trade-off Loki declines), labels do narrow the scan, and the compactor merges index files rather than summarising content.
Official docs