Search code examples
searchindexingsearch-engine

Misconeptions about search indexing? (Haystack/Whoosh)


I'm using haystack with whoosh for development purposes. I want search results based on django models to be filtered by the user that created them.

Please see my other post Filter haystack result with SearchQuerySet for details.

Basically I had to add User to my search index. But I noticed, when I manually change the user_id of a record, search is broken. After thinking about it this even makes sense. But, this means I have to rebuild the index after each field update in each model? Surely that doesn't scale at all?

I thought the engine would find the object by id, then look it up in the database, and return a current instance for further processing like filtering. It seems like everything is cached in the index so must be synchronized in realtime for search results to show up? Am I missing something here?


Solution

  • This documentation helped shed some light:

    http://docs.haystacksearch.org/dev/searchindex_api.html