laravel - 求elasticsearch client php 搜索及排序方式方法
巴扎黑
巴扎黑 2017-04-11 08:57:32
[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);

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

巴扎黑
巴扎黑

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号