탄성 검색 2.3.3을 사용하여 데이터 색인을 생성하는 Java 프로젝트가 있습니다. 인덱스는 두 가지 유형입니다. 내가 특정 이름의 인덱스를 삭제하고 만 입력해야인덱스 이름과 유형별 색인 삭제 elasticSearch 2.3.3 in java
{
"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"
}
}
]
}
}
: 같은
내 인덱스 문서 보인다. 예를 들어
: - 위의 문서에서, 나는 이름 "test_index"와 인덱스를 삭제하고 "드라마"을 입력합니다.
{
"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"
}
}
]
}
}
솔루션을 시도 : 같은
그래서 결과는 같아야합니다client.admin을() 인덱스를() (새 DeleteIndexRequest를 ("test_index") 삭제 actionGet을 (...)
하지만
이름 "test_index"에 모두 인덱스를 삭제 10 나는 또한 의미 베타 플러그인 같은 다양한 쿼리를 시도 :삭제/test_index/드라마 그것은 오류가 제공
: 없음 핸들러가 URI [/ test_index/드라마] 및 방법 [을 찾을 수 없습니다를 삭제]
DELETE/test_index/드라마/_query Q = _id : * & analyze_wildcard = 사실
그것을 또한 작동하지 않습니다.
그 순간에 색인 요청을 삭제하면 색인의 ID를 알 수 없으므로 이름과 유형별로 색인을 삭제해야합니다.
Java API를 사용하여 필요한 색인을 삭제하려면 어떻게해야합니까?
와 함께 당신을 도울 수 있습니다.co/guide/ko/elasticsearch/plugins/2.3/plugins-delete-by-query.html)? 최신 쿼리는 나를 위해 작동하고'test_index/drama'에서 문서 만 삭제합니다. – Val