Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to fix none in search results #304

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
Loading