: Elasticsearch 3DSL Summary: & lt ;? Phpmatch_phrase match phrase: the result of rolecoding is rolecoding & lt; span & gt; match. the result of the full-text query rolecoding includes all role, coding & lt; span & g
['Id' => ['order' => $ sort], 'size' => $ size]; // equivalent to count () Mode 1 {"aggs ": {"genres": {"terms": {"field": "advertiser" }}}method 2 {"aggs": {"genres": {"terms ": {"field": "advertiser", "order": {"_ count": "desc" }}, "aggs": {"status": {"terms ": {"field": "status", "order": {"_ count": "desc" }}}}}method 3 {"query ": {"bool": {"must": {"match": {"title": "c" }}}, "aggs": {"genres ": {"terms": {"field ": "advertiser" }}}// range query $ curl_param = ['sort '=> ['id' => ['order' => $ sort], 'size' => $ size, 'query' => ['Bool '=> ['must' => ['range' => ['id' => ['GT '=> $ rand_id] ]; // use a term equivalent to SQL where id = 3 $ curl_param = ['sort '=> ['id' => ['order' => 'desc'], 'size' => $ size, 'query' => ['condition' => ['platform' => $ platform]; // bool set query // fuzzy search is equivalent to % $ curl_param = ['sort '=> ['id' => ['order' => 'desc'], 'size' => $ size, 'query' => ['Bool '=> ['must' => [['term '=> ['type' => $ type], ['condition' => ['platform' => $ platform], 'short' => [['fuzzy' => ['title' => ['value' => $ param], ['fuzzy' => ['domain '=> ['value' => $ param]; // max min query $ curl_param = ['query' => ['Bool '=> ['must' => ['term '=> ['id' => $ id ], 'agggs' => ['first _ detected' => ['min' => ['Field '=> 'created _ date'], 'last _ detected' => ['Max '=> ['Field' => 'created _ date']; // groub By query // group_by_state $ curl_param = ['query' => ['Bool '=> ['must' => [['term '=> [$ isfield => 1], ['condition' => ['host' => $ host], 'aggs' => ['group _ by_state '=> ['terms' => ['Field' => $ field]; // multi-field query $ curl_param = ['sort '=> ['id' => ['order' => 'desc'], 'query' => ['multi _ match' => ['query' => $ title, 'type' => 'best _ Fields ', 'fields' => ['title', 'domain ', 'keyword'], 'Tie _ breaker' => 0.3, 'minimum _ should_match '=> '20140901']; // filter to use $ curl_param = ['sort' => ['id' => 'desc'], 'query' => ['filtered' => ['filter' => ['range' => ['id' => ['gte' => $ min_id, 'lte '=> $ max_id]; $ curl_param = ['sort '=> ['id' => ['order' => 'desc'], 'size' => $ size, 'query' => ['Bool '=> ['must' => [['fuzzy' => ['title' => $ param], ['condition' => ['type' => $ type], ['condition' => ['platform' => $ platform], ['condition' => ['shape' => $ shape], ['range' => ['created _ date' => ['gte' => $ startTime, 'Lt '=> $ endTime], ['range' => ['id' => ['gte' => $ last_id]; // shocould use // foreach ($ param as $ key => $ value) {if ($ value) {$ should_arr [] = ['condition' => ['id' => $ value];} $ curl_param = ['query' => ['Bool '=> ['shot' => $ should_arr];
The above describes the summary of es learning 3 DSL, including some content, and hope to be helpful to friends who are interested in PHP tutorials.