Skip to content

Commit

Permalink
Add command to fix none in search results (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix authored Nov 20, 2023
1 parent 694b2e1 commit d0195c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ $ make devweb-runserver
```
and now, you can see your site at `http://0.0.0.0:62202` (skip this step if you are using PyCharm interpreter)

- If 'None' appears in the search results, it indicates a misalignment between the search index and the database. This discrepancy often arises when a plugin is deleted from the model but persists in the search index. To rectify this issue, it is essential to synchronize the search index with the database by rebuilding it. Execute the following command to initiate the rebuilding process:

```bash
$ make rebuild_index
```
This command ensures that the search index accurately reflects the current state of the database, resolving the presence of 'None' in the search results. Automatic synchronization is currently managed in settings.py: `HAYSTACK_SIGNAL_PROCESSOR = "haystack.signals.RealtimeSignalProcessor"`.

---

### Setup git-hooks and local linting
Expand Down
7 changes: 7 additions & 0 deletions dockerize/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,10 @@ dbseed:
@echo "Seed db with JSON data from /fixtures/*.json"
@echo "------------------------------------------------------------------"
@docker-compose -p $(PROJECT_ID) exec devweb bash -c 'python manage.py loaddata fixtures/*.json'

rebuild_index:
@echo
@echo "------------------------------------------------------------------"
@echo "Rebuild search index in PRODUCTION mode"
@echo "------------------------------------------------------------------"
@docker-compose -p $(PROJECT_ID) exec web bash -c 'python manage.py rebuild_index'

0 comments on commit d0195c1

Please sign in to comment.