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]],
                    ],

                ],
            ];

 

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-10-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-06
  • 2021-05-22
  • 2021-08-11
  • 2021-07-02
  • 2022-12-23
  • 2021-11-10
相关资源
相似解决方案