Jump to >

reviewboard.search.signal_processor

The signal processor for Review Board search.

class SignalProcessor(*args, **kwargs)[source]

“Listens for signals and updates the search index.

This will listen for any signals that would affect the search index, and invokes a suitable Haystack callback to immediately update the data stored in the index.

This only updates the search index if:

  1. Search is enabled.

  2. The current search engine backend supports on-the-fly indexing.

property can_process_signals[source]

Whether the signal processor can currently process signals.

setup()[source]

Register the signal handlers for this processor.

teardown()[source]

Unregister all signal handlers for this processor.

check_handle_save(instance_kwarg, **kwargs)[source]

Conditionally update the search index when an object is updated.

Parameters
  • instance_kwarg (unicode) – The name of the instance parameter.

  • **kwargs (dict) – Signal arguments. These will be passed to handle_save().

check_handle_delete(**kwargs)[source]

Conditionally update the search index when an object is deleted.

Parameters

**kwargs (dict) – Signal arguments. These will be passed to handle_delete().

handle_save(**kwargs)[source]

Update the search index when an object is updated.

If there’s any error writing to the search backend, the error will be caught and logged.

Parameters

**kwargs (dict) – Signal arguments. These will be passed to handle_save().

handle_delete(**kwargs)[source]

Update the search index when an object is deleted.

If there’s any error writing to the search backend, the error will be caught and logged.

Parameters

**kwargs (dict) – Signal arguments. These will be passed to handle_save().