elasticsearch in语句和not in语句


sql语句示例:

select * from table where t_id in (1,2,3,4)

 

 php代码示例:

            $search_query = [
                "bool" => [
                    "must" => [
                        ["term" => ["type" => 'thread']],
                        ["range" => ["id" => ['lte' => $top_tid]]]//gte
                    ],

                    // in
                    /*
                    "filter" => [
                        "terms" => ["fid" => [43, 44]],
                    ],
                    */

                    // not in

                    "must_not" => [
                        "terms" => ["fid" => [44]],
                    ],

                ],
            ];

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM