Code Monkey home page Code Monkey logo

aldryn-search's Introduction

aldryn-search

This package provides a search indexes for easy Haystack 2 integration with django CMS.

Usage

After installing aldryn-search through your package manager of choice, add aldryn_search to your INSTALLED_APPS. If you run a multilingual CMS setup, you have to define a haystack backend for every language in use:

HAYSTACK_CONNECTIONS = {
    'en': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://my-solr-server/solr/my-site-en/',
        'TIMEOUT': 60 * 5,
        'INCLUDE_SPELLING': True,
        'BATCH_SIZE': 100,
    },
    'fr': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://my-solr-server/solr/my-site-fr/',
        'TIMEOUT': 60 * 5,
        'INCLUDE_SPELLING': True,
        'BATCH_SIZE': 100,
    },
}

To make sure the correct backend is used during search, add aldryn_search.router.LanguageRouter to your HAYSTACK_ROUTERS setting:

HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter',]

For a complete Haystack setup, please refer to their documentation.

For more docs, see the docs folder or the online documentation.

Integration with django CMS

aldryn-search comes with an App Hook for django CMS, and a search view using Django's class based views. If you want to use this app hook, you can either subclass it and register it yourself, or set ALDRYN_SEARCH_REGISTER_APPHOOK to True.

For pagination, aldryn-search uses aldryn_search.contrib.paginator.DiggPaginator. If you want to use this built-in pagination, make sure to install`django-spurl <https://github.com/j4mie/django-spurl>`_, and add then add spurl to INSTALLED_APPS.

aldryn-search's People

Contributors

beniwohli avatar finalangel avatar johnraz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.