FinalsClub / karmaworld

KarmaNotes.org v3.0
GNU Affero General Public License v3.0
7 stars 6 forks source link

is indexden optional? #443

Closed btbonval closed 9 years ago

btbonval commented 9 years ago

IndexDen is noted as "optional but recommended" in the README.

However, while running through local environment config, the following occurs:

$ foreman run python manage.py syncdb --migrate --noinput
KeyError: 'INDEXDEN_INDEX'

No stacktrace, and it certainly implies that IndexDen is required.

btbonval commented 9 years ago

This is the only place INDEXDEN_INDEX env var is referred to in code: https://github.com/FinalsClub/karmaworld/blob/aa3b27296dff8b7707645e0bbbfcc8c708222841/karmaworld/apps/notes/search.py#L23-L24

It would seem that the code does not currently consider IndexDen to be optional, though I would prefer it be optional.

Can the search be easily modified to skip IndexDen if not available? If yes, make that change. If not, update documentation.

btbonval commented 9 years ago

It looks like each function has MOCK_MODE constant checked. If enabled, it appears to skip all search features. This comes from settings.TESTING, which is set here: https://github.com/FinalsClub/karmaworld/blob/650d4f06752fcebbd58945eb31c9485b1e580864/karmaworld/settings/common.py#L397

Ironically even if settings.TESTING is enabled, the env var is still expected or crash. So let's leave settings.TESTING as it was. If INDEXDEN_INDEX is missing from env var, then we can also assume MOCK_MODE is in effect independently of settings.TESTING.

btbonval commented 9 years ago

Putting the code in place to set MOCK_MODE if INDEXDEN_INDEX (and others) are missing helped get further in configuration. I won't consider this valid until the site is up and running and the search bar does not crash. The search bar shouldn't do anything ... including should not crash.

btbonval commented 9 years ago

Site is up and running locally, search appears to do nothing at all (as desired in this case).