Commit b599f53d authored by 赵威's avatar 赵威

update es query

parent d6eacac5
...@@ -85,15 +85,19 @@ object ESClient { ...@@ -85,15 +85,19 @@ object ESClient {
object ES { object ES {
def test() { def test() {
val client = ESClient.create("172.16.52.33", 9200, "elastic", "gengmei!@#") val client = ESClient.create("172.16.52.33", 9200, "elastic", "gengmei!@#")
val json = """
val json = {
""" "query": {
|{ "bool": {
| "query" : {"bool": {"filter": [ "filter": [
| "terms": {"tags_v3" : ["光子嫩肤", "水光针"]} {
| ]}} "terms": { "tags_v3": ["光子嫩肤", "水光针"] }
|} }
|""".stripMargin ]
}
}
}
"""
val resp = client.execute { val resp = client.execute {
search("gm-dbmw-diary-read").source(json) search("gm-dbmw-diary-read").source(json)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment