From 4e68c2fed441eaf029115aded6cc8ced029b04e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20St=C3=A4hli?= Date: Tue, 23 Jan 2024 09:54:11 +0100 Subject: [PATCH] docs --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8befeca..663ebca 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Describe, index, search. Default value, simplest possible configuration: -``` +```python POSTGRES_SEARCHINDEX = { "default": {}, } @@ -36,7 +36,7 @@ POSTGRES_SEARCHINDEX = { Example for a multilanguage setup: -``` +```python POSTGRES_SEARCHINDEX = { "de": { "kwargs": { @@ -58,7 +58,7 @@ in searchindex key and kwargs. Example, hopefully self explaining. -``` +```python from django.utils.html import strip_tags from postgres_searchindex.base import IndexSource / MultiLanguageIndexSource from postgres_searchindex.source_pool import source_pool @@ -85,7 +85,7 @@ Place this code in `index_sources.py` of your app, and it will be autodiscovered Run `./manage.py postgres_searchindex_update` to update/build the index. -``` +```shell ยป ./manage.py postgres_searchindex_update ==================================== Updating index "de" with kwargs {'language': 'de'} @@ -113,7 +113,7 @@ your `IndexEntry` instances in Django admin. You can now search in your index. You are free to use [Django's builtin fulltext](https://docs.djangoproject.com/en/dev/ref/contrib/postgres/search/) features as you like - as in the following example, or in a way more advanced manner. -``` +```python from django.contrib.postgres.search import SearchVector from postgres_searchindex.models import IndexEntry