求elasticsearch client php 搜索及排序方式方法

本人用的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);

想了解以下问题:
一、都有哪些查询方法,主要针对多字段批配时,希望能举例说明。
二、为什么我查询时正常,但加上时间字段排序就出现好多重复的结果?求如何排序(按时间字段)查询结果

阅读 3.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题