Johnny Woo
Johnny Woo

Reputation: 187

How to erase a realtime index in Sphinx?

I want to use a realtime index as an instantly available delta for today's changes, so it needs to be erased nightly. Is there a nice way to remove all documents from an RT-index? I suppose I could select everything from it and issue a DELETE for every found id, but that does not seem to be a wise way.

Upvotes: 9

Views: 4606

Answers (3)

user697576
user697576

Reputation: 827

I've tried TRUNCATE RTINDEX ... without any luck. The easiest method I found was to change the path configuration of the index. eg:

index myindex { type = rt path = /var/lib/sphinxsearch/data/myindex ... to

index myindex { type = rt path = /var/lib/sphinxsearch/data/myindex-v2 ...

Upvotes: 0

tmg_tt
tmg_tt

Reputation: 474

TRUNCATE RTINDEX rt_user was added in sphinx 2.2.2

Upvotes: 14

chx
chx

Reputation: 11770

It seems this is not yet possible. http://sphinxsearch.com/forum/view.html?id=6898 deals with this question and the only solution the forum mentions is shutting down Sphinx, clearing out binlog and the relevant files of the index and restart.

Upvotes: 0

Related Questions