本人用的laravel调用 elasticsearch client 2.x
$params = [ 'index' => 'aindex', 'type' => 'atype', 'body' => [ 'query' => [ 'dis_max' => [ 'queries' => [ [ 'match' => [ 'ntitle' => $word]], [ 'match' => [ 'description' => $word]] ] ,'tie_breaker'=>0.3 ] ] //,'sort' => ['ndate'=>['order'=>'desc']] , 'from' => $fr, 'size' => $s ] ]; $res = $this->client->search($params);
想了解以下问题:
一、都有哪些查询方法,主要针对多字段批配时,希望能举例说明。
二、为什么我查询时正常,但加上时间字段排序就出现好多重复的结果?求如何排序(按时间字段)查询结果