You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To eager load associations, use the search_import scope.
(...)
By default, all records are indexed. To control which records are indexed, use the should_index? method together with the search_import scope.
Now an obvious extrapolation here would be to add where to search_import to eliminate records that should not be indexed. This is a suggestion also present in some issues like #1503.
I've tested this out and it does work to eliminate records, but there is one major caveat - if a record is already indexed, then updated such that the where in search_import no longer matches it, the record remains in the index.
Removing search_import in the above example fixes the issue.
I'm not sure if this is intended functionality, but if it is, this should be documented - for example by saying that where should only added to search_import if the record will never be updated so that it shouldn't be indexed.
The text was updated successfully, but these errors were encountered:
The readme explains
search_import
as such:Now an obvious extrapolation here would be to add
where
tosearch_import
to eliminate records that should not be indexed. This is a suggestion also present in some issues like #1503.I've tested this out and it does work to eliminate records, but there is one major caveat - if a record is already indexed, then updated such that the
where
insearch_import
no longer matches it, the record remains in the index.For example:
Removing
search_import
in the above example fixes the issue.I'm not sure if this is intended functionality, but if it is, this should be documented - for example by saying that
where
should only added tosearch_import
if the record will never be updated so that it shouldn't be indexed.The text was updated successfully, but these errors were encountered: