다른 검색어로 동일한 용어 요청을 여러 번 반복하지만 숫자 배열에 대한 요청을 만들고 싶습니다.
이것은 should 컨테이너에 세 가지 다른 용어 쿼리가있는 내 요청입니다.
POST /test_index/film_type/_search
{
"query": {
"bool": {
"filter": [
{
"bool": {
"should": [
{
"term": {
"id_film": {
"value": 4
}
}
},
{
"term": {
"id_film": {
"value": 5
}
}
},
{
"term": {
"id_film": {
"value": 45
}
}
}
]
}
}
]
}
}
}
제발 어떻게하는지 알아?
간단한 쿼리 문자열 쿼리를 살펴볼 수 있습니다.
작은 예 :
POST test/test/1
{
"film-id": 1
}
POST test/test/2
{
"film-id": 2
}
POST test/test/3
{
"film-id": 3
}
GET test/_search
{
"query": {
"simple_query_string": {
"query": "1 | 2",
"fields": [
"film-id"
]
}
}
}
결과:
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "test",
"_type": "test",
"_id": "2",
"_score": 1,
"_source": {
"film-id": 2
}
},
{
"_index": "test",
"_type": "test",
"_id": "1",
"_score": 1,
"_source": {
"film-id": 1
}
}
]
}
}
도움이 되었기를 바랍니다!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다