Mam projektu w java, gdzie indeksowania danych za pomocą elastycznego wyszukiwania 2.3.3. Indeksy są dwojakiego rodzaju.Usuwanie indeksów według nazwy i typu indeksu za pomocą elasticSearch 2.3.3 w java
Mój indeks doc wygląda następująco:
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": [
{
"_index": "test_index",
"_type": "movies",
"_id": "uReb0g9KSLKS18sTATdr3A",
"_score": 1,
"_source": {
"genre": "Thriller"
}
},
{
"_index": "test_index",
"_type": "drama",
"_id": "cReb0g9KSKLS18sTATdr3B",
"_score": 1,
"_source": {
"genre": "SuperNatural"
}
},
{
"_index": "index1",
"_type": "drama",
"_id": "cReb0g9KSKLS18sT76ng3B",
"_score": 1,
"_source": {
"genre": "Romance"
}
}
]
}
}
muszę usunąć indeks danej nazwy i wpisać tylko.
Dla np: - Z powyższego dokumentu, chcę usunąć indeksy z nazwą "test_index" i wpisz "Drama".
więc wynik powinien wyglądać następująco:
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "test_index",
"_type": "movies",
"_id": "uReb0g9KSLKS18sTATdr3A",
"_score": 1,
"_source": {
"genre": "Thriller"
}
},
{
"_index": "index1",
"_type": "drama",
"_id": "cReb0g9KSKLS18sT76ng3B",
"_score": 1,
"_source": {
"genre": "Romance"
}
}
]
}
}
Solutions próbowałem:
client.admin indeksy()() (nowa DeleteIndexRequest usunąć ("test_index") actionGet (...);
Ale to usunąć oba indeksy z nazwą "test_index"
Próbowałem również różne zapytania w sensie beta wtyczki jak:
DELETE/test_index/dramat
To daje błąd: Brak obsługi znalezionych dla URI [/ test_index/dramy] i metody [ DELETE]
DELETE/test_index/dramat/_query q = _id: * & analyze_wildcard = true
It również nie działa.
Kiedy odpalam żądanie usunięcia indeksu w tym czasie identyfikator indeksów jest nam nieznany i muszę usunąć indeksy tylko według nazwy i typu.
Jak mogę usunąć wymagane indeksy za pomocą interfejsu API java?
Jeżeli masz zainstalowane [Delete po zapytaniu plugin] (https: //www.elastic.co/guide/pl/elasticsearch/plugins/2.3/plugins-delete-by-query.html)? Ostatnie zapytanie działa dla mnie i usuwa tylko dokumenty z 'test_index/drama' – Val