Code Monkey home page Code Monkey logo

celery-haystack's Introduction

celery-haystack

Build Status

This Django app allows you to utilize Celery for automatically updating and deleting objects in a Haystack search index.

Requirements

You also need to install your choice of one of the supported search engines for Haystack and one of the supported backends for Celery.

Installation

Use your favorite Python package manager to install the app from PyPI, e.g.:

pip install celery-haystack

By default a few dependencies will automatically be installed:

Usage

Haystack 1.X

  1. Add 'celery_haystack' to the INSTALLED_APPS setting

    INSTALLED_APPS = [
        # ..
        'celery_haystack',
    ]
  2. Alter all of your SearchIndex subclasses to inherit from celery_haystack.indexes.CelerySearchIndex

    from haystack import site, indexes
    from celery_haystack.indexes import CelerySearchIndex
    from myapp.models import Note
    
    class NoteIndex(CelerySearchIndex):
        text = indexes.CharField(document=True, model_attr='content')
    
    site.register(Note, NoteIndex)
  3. Ensure your Celery instance is running.

Haystack 2.X

  1. Add 'celery_haystack' to the INSTALLED_APPS setting

    INSTALLED_APPS = [
        # ..
        'celery_haystack',
    ]
  2. Enable the celery-haystack signal processor in the settings

    HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor'
  3. Alter all of your SearchIndex subclasses to inherit from celery_haystack.indexes.CelerySearchIndex and haystack.indexes.Indexable

    from haystack import indexes
    from celery_haystack.indexes import CelerySearchIndex
    from myapp.models import Note
    
    class NoteIndex(CelerySearchIndex, indexes.Indexable):
        text = indexes.CharField(document=True, model_attr='content')
    
        def get_model(self):
            return Note
  4. Ensure your Celery instance is running.

Thanks

This app is a blatant rip-off of Daniel Lindsley's queued_search app but uses Ask Solem Hoel's Celery instead of the equally awesome queues library by Matt Croyden.

Issues

Please use the Github issue tracker for any bug reports or feature requests.

celery-haystack's People

Contributors

jezdez avatar stefanw avatar ntucker avatar regadas avatar akestner avatar anacarolinats avatar entequak avatar kronuz avatar zbyte64 avatar bohde avatar thedrow avatar ross avatar stephenmcd 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.