From b76317b9d0c623477ac786a011477ac12b9c596f Mon Sep 17 00:00:00 2001 From: Xargin Date: Wed, 11 Jul 2018 12:11:53 +0800 Subject: [PATCH] update --- ch6-cloud/ch6-x-dist-search-engine.md | 61 +++++++++++++++------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/ch6-cloud/ch6-x-dist-search-engine.md b/ch6-cloud/ch6-x-dist-search-engine.md index 35c5f70..ecc3a45 100644 --- a/ch6-cloud/ch6-x-dist-search-engine.md +++ b/ch6-cloud/ch6-x-dist-search-engine.md @@ -97,38 +97,43 @@ es 定义了一套查询 DSL,当我们把 es 当数据库使用时,需要用 { "query": { "bool": { - "must": [{ - "match": { - "field_1": { - "query": "1", - "type": "phrase" + "must": [ + { + "match": { + "a": { + "query": "1", + "type": "phrase" + } + } + }, + { + "match": { + "b": { + "query": "2", + "type": "phrase" + } + } + }, + { + "match": { + "c": { + "query": "3", + "type": "phrase" + } + } + }, + { + "match": { + "d": { + "query": "4", + "type": "phrase" + } } } - }, { - "match": { - "field_2": { - "query": "2", - "type": "phrase" - } - } - }, { - "match": { - "field_3": { - "query": "3", - "type": "phrase" - } - } - }, { - "match": { - "field_4": { - "query": "4", - "type": "phrase" - } - } - }] + ] } }, "from": 0, "size": 1 } -``` +``` \ No newline at end of file