|
| 1 | +# Setup the Find search for Impress |
| 2 | + |
| 3 | +This configuration will enable the fulltext search feature for Docs : |
| 4 | +- Each save on **core.Document** or **core.DocumentAccess** will trigger the indexer |
| 5 | +- The `api/v1.0/documents/search/` will work as a proxy with the Find API for fulltext search. |
| 6 | + |
| 7 | +## Create an index service for Docs |
| 8 | + |
| 9 | +Configure a **Service** for Docs application with these settings |
| 10 | + |
| 11 | +- **Name**: `docs`<br>_request.auth.name of the Docs application._ |
| 12 | +- **Client id**: `impress`<br>_Name of the token audience or client_id of the Docs application._ |
| 13 | + |
| 14 | +See [how-to-use-indexer.md](how-to-use-indexer.md) for details. |
| 15 | + |
| 16 | +## Configure settings of Docs |
| 17 | + |
| 18 | +Add those Django settings the Docs application to enable the feature. |
| 19 | + |
| 20 | +```shell |
| 21 | +SEARCH_INDEXER_CLASS="core.services.search_indexers.FindDocumentIndexer" |
| 22 | +SEARCH_INDEXER_COUNTDOWN=10 # Debounce delay in seconds for the indexer calls. |
| 23 | + |
| 24 | +# The token from service "docs" of Find application (development). |
| 25 | +SEARCH_INDEXER_SECRET="find-api-key-for-docs-with-exactly-50-chars-length" |
| 26 | +SEARCH_INDEXER_URL="http://find:8000/api/v1.0/documents/index/" |
| 27 | + |
| 28 | +# Search endpoint. Uses the OIDC token for authentication |
| 29 | +SEARCH_INDEXER_QUERY_URL="http://find:8000/api/v1.0/documents/search/" |
| 30 | +``` |
| 31 | + |
| 32 | +We also need to enable the **OIDC Token** refresh or the authentication will fail quickly. |
| 33 | + |
| 34 | +```shell |
| 35 | +# Store OIDC tokens in the session |
| 36 | +OIDC_STORE_ACCESS_TOKEN = True # Store the access token in the session |
| 37 | +OIDC_STORE_REFRESH_TOKEN = True # Store the encrypted refresh token in the session |
| 38 | +OIDC_STORE_REFRESH_TOKEN_KEY = "your-32-byte-encryption-key==" # Must be a valid Fernet key (32 url-safe base64-encoded bytes) |
| 39 | +``` |
0 commit comments