Код: Выделить всё
public void deleteAll() {
// Optionally drop and recreate the index
try (Connection connection = jedis.getPool().getResource()) {
if (connection.isConnected()) {
connection.sendCommand(SearchProtocol.SearchCommand.DROPINDEX, "DROPINDEX", "spring-ai-example", "DD"); // Use your configured index name
} else {
logger.warn("Connection is not valid");
}
} catch (Exception e) {
// Index might not exist, that's okay
logger.warn("Failed to drop index", e);
}
}
Код: Выделить всё
redis-cli FT._LIST
1) spring-ai-example
Версия cli работает...
< р>
Код: Выделить всё
redis-cli FT.DROPINDEX spring-ai-example DD
Подробнее здесь: https://stackoverflow.com/questions/792 ... sing-jedis