toastdriven/django-haystack — Issue #499: `get_modified_field` companion method to allow the user to manually filter
Author: avidal
Created: 2012-02-07 16:09:11+00:00
State: open

The problem I have is that I'm adding search functionality to an existing database where I only have read access. The database backs Microsoft Dynamics GP, which is an enterprise ERP system.

The model I'm indexing has a last modified field, but it also has a related object that I'm including in its index that has its own last modified field. Ideally, I'd be able to indicate that a given object should be reindexed if either of the modified fields are within the threshold.

Currently, the update_index management command pulls the initial queryset from `SearchIndex.index_queryset` and then manually applies the cutoff filter using `SearchIndex.get_modified_field` and the `age` argument passed into the command. I think that a companion method to `get_modified_field` named `get_modified_queryset` that allows the developer to manually apply the filter would be a huge help.