Daria
Daria

Reputation: 753

Full-text content searching for Django-CMS

Probably the best way to integrate search with the Django-CMS is Haystack.

There is a search_indexes.py snippet at django-cms documentation. Does anybody managed to get this up and running?

I'm using whoosh as the search engine. Haystack works fine with my models, but this snippet for cms.Page model does not work. The behavior is not consistent. Usually I'm getting No results found message, but sometimes after running manage.py rebuild_index, or update_index I'm getting results for the same query string. The thing is, rebuild_index is not always helping. Could anybody help me to understand what's going on?

Upvotes: 0

Views: 2160

Answers (2)

garmoncheg
garmoncheg

Reputation: 906

There is a plugin for CMS called aldryn-search. It is currently did the trick for me. I use whoosh and haystack and it works.

My settings.py config for this is:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
        'PATH': os.path.join(PROJECT_PATH, 'whoosh_index'),
    },
}
HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter', ]
ALDRYN_SEARCH_REGISTER_APPHOOK = True

Upvotes: 3

ojii
ojii

Reputation: 4781

There's https://github.com/piquadrat/django-cms-search which is lacking tests at the moment but will become the standard haystack tool for the django-cms.

Upvotes: 1

Related Questions