pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 470 forks source link

ts:index on a specific index #1196

Closed kalsan closed 3 years ago

kalsan commented 3 years ago

Hi Pat!

Hope you're doing well. Here's another idea that might be interesting and I'm looking forward to hearing what you think of it. When indexing fails, e.g. due to a bug, or if a specific data set has changed, it would be nice to be able to re-index a specific index.

For instance:

app/indices/document_index.rb with TONS of documents app/indices/person_index.rb needs to be re-indexed

Running ts:index would take 30+ minutes due to the documents. Commenting out the code in document_index.rb would cause the index to complete in 1 minute.

So something like ts:index person would come in handy in this situation.

Best Kalsan

pat commented 3 years ago

Hi Kalsan :)

This is actually possible - it's just hidden at the very end of this page in the documentation: https://freelancing-gods.com/thinking-sphinx/v5/indexing.html#processing - so perhaps this does the trick for you:

bundle exec rake ts:index INDEX_FILTER=person_core
kalsan commented 3 years ago

Awesome, thanks a lot! I was searching in https://freelancing-gods.com/thinking-sphinx/v5/rake_tasks.html which is why I missed it.

Thank you and have a nice day!