여러 단어 중 하나 일치를 위한 query 방법들 정리.
//sql
select ~ from ~ where action = "hi" or "bye"
- match의 띄워쓰기를 통한 query (hi , bye);
{
"query":{
"match":{
"action" : "hi bye"
}
}
}
2. should를 통한 OR 조건 추가.
{
"query": {
"filtered": {
"filter": {
"bool": {
"should": [
{"term": {"action.keyword": "hi"}},
{"term": {"action.keyword": "bye"}}
]
}
}
}
}
}
3. terms에 추가하여 query
{
"query":{
"terms":{"action":["hi","bye"]}
}
}