メインコンテンツまでスキップ

30. 엘라스틱서치 요모조모

기본 like검색

{
"query" : {
"query_string" : {
"query" : "*gin*"
}
}
}

nested like검색

table의 UDT타입 내부의 데이터를 like 검색 할 때 사용하면 된다.

{
"query": {
"nested": {
"path": "username",
"query": {
"wildcard": {
"username.first": "*keyword*"
}
}
}
}
}

restapi 방식 검색

test키스페이스의 docs라는 테이블을 검색할 때
http://localhost:9200/test/docs/_search

Get방식

http://localhost:9200/test/docs/_search?q=gin

Post방식

http://localhost:9200/test/docs/_search
body에

{
"query" : {
"query_string" : {
"query" : "*gin*"
}
}
}