mysociety / sayit

SayIt - a component for recording and storing public statements.
http://sayit.mysociety.org/
Other
105 stars 38 forks source link

Docs: Search-related management commands #299

Open jpmckinney opened 10 years ago

jpmckinney commented 10 years ago

I'm not sure when I would run these:

Also, when (if ever) do I need to run the haystack commands?

dracos commented 10 years ago

For the latter, currently you will need to run them whenever you want to update the search index. The example project should probably have HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' for ease of getting running (that updates the search index whenever a database model changes), I'm not sure why it doesn't have that.

For the former - I implemented this for sayit.mysociety.org but hadn't yet worked out if that was enough for general use or if something more was needed. You don't need to run them at all if you just use it is set up by default. If you want to have the ability to rebuild the entire index without any search downtime (using e.g. the rebuild_index command, for example if you wish to change something that involves creating an index from scratch, say a new mapping), then you could use new_index to create a timestamped index, aliased to _write, use that to populate a new search index, then use make_index_live to point a read alias at the same index.

jpmckinney commented 10 years ago

I'll leave this open, so that this info is put somewhere in the docs eventually, but it's not urgent (feel free to "Ice box").