Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new option to ignore search_import #1632

Closed
yanghoxom opened this issue Apr 27, 2023 · 5 comments
Closed

new option to ignore search_import #1632

yanghoxom opened this issue Apr 27, 2023 · 5 comments

Comments

@yanghoxom
Copy link

After defining the search_import, every time I reindex, it is automatically used and there is no way for me to skip it, even when my scope only has 1-2 records.
Currently, I can also solve the problem by writing additional logic checks in search_import, but I think it would be great if you could support it.
I hope we have an option that can limit the minimum number of records to use search_import, or we can skip it.

.reindex(search_import: false)
.reindex(search_import_when: 10)

@ankane
Copy link
Owner

ankane commented Apr 27, 2023

Hi @memsenpai, can you share more about why you want to skip it?

@yanghoxom
Copy link
Author

@ankane
When the default scope is very small or just 1, using "include" for preload doesn't really help and will make everything worse.

@ankane
Copy link
Owner

ankane commented May 8, 2023

Hi @memsenpai, I don't really understand how it makes things worse, but you can call reindex on individual records to skip it.

Searchkick.callbacks(:bulk) do
  Product.where(...).map(&:reindex)
end

@ankane ankane closed this as completed May 8, 2023
@davidwparker
Copy link

@ankane - I have the same request as this, and it's better phrased here:

#1639

@abdul-wahab-qbatch
Copy link

@ankane & @davidwparker do we have any update regarding this? This is causing a lot of queries that are not required in partial reindexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants