Browse Source

Usa Whoosh por default, ou solr se especificado no .env

pull/1064/head
Edward Ribeiro 9 years ago
parent
commit
6daa617356
  1. 17
      sapl/settings.py

17
sapl/settings.py

@ -84,13 +84,22 @@ INSTALLED_APPS = (
) + SAPL_APPS
# FTS = Full Text Search
SEARCH_BACKEND = 'haystack.backends.whoosh_backend.WhooshEngine'
SEARCH_URL = ('PATH', PROJECT_DIR.child('whoosh'))
SOLR_URL = config('SOLR_URL', cast=str, default='')
if SOLR_URL:
SEARCH_BACKEND = 'haystack.backends.solr_backend.SolrEngine'
SEARCH_URL = ('URL', config('SOLR_URL', cast=str))
# ...or for multicore...
# 'URL': 'http://127.0.0.1:8983/solr/mysite',
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': config('SOLR_URL', cast=str)
# ...or for multicore...
# 'URL': 'http://127.0.0.1:8983/solr/mysite',
'ENGINE': SEARCH_BACKEND,
SEARCH_URL[0] : SEARCH_URL[1]
},
}

Loading…
Cancel
Save