From 4210ea06c361bd60c2b3466c1a86ee0db73d5efc Mon Sep 17 00:00:00 2001 From: Bastien Gerard Date: Tue, 12 Oct 2021 21:02:12 +0200 Subject: [PATCH] Improve compound indexes in rst --- docs/guide/defining-documents.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide/defining-documents.rst b/docs/guide/defining-documents.rst index 186dd4a5..d86d6b9d 100644 --- a/docs/guide/defining-documents.rst +++ b/docs/guide/defining-documents.rst @@ -477,7 +477,7 @@ dictionary containing a full index definition. A direction may be specified on fields by prefixing the field name with a **+** (for ascending) or a **-** sign (for descending). Note that direction -only matters on multi-field indexes. Text indexes may be specified by prefixing +only matters on compound indexes. Text indexes may be specified by prefixing the field name with a **$**. Hashed indexes may be specified by prefixing the field name with a **#**:: @@ -488,14 +488,14 @@ the field name with a **#**:: created = DateTimeField() meta = { 'indexes': [ - 'title', + 'title', # single-field index '$title', # text index '#title', # hashed index - ('title', '-rating'), - ('category', '_cls'), + ('title', '-rating'), # compound index + ('category', '_cls'), # compound index { 'fields': ['created'], - 'expireAfterSeconds': 3600 + 'expireAfterSeconds': 3600 # ttl index } ] }