elasticSearch查詢(一)

**整理成sql格式來看懂elastic**sql

1、多個字段多個and查詢spa

sql格式:select * from product where title = 'xxxx' and pid = 12 limit 1,2000;code

es格式:blog

$params = array(

    'index' => '你的index',

    'type' => '你的type',

    'body'=>array(

          'from'=>1,

          'size'=>2000,

          'query'=>array(

              'bool'=>array(

                   'must'=>array(

                       array(

                           'match'=>array(

                               'pid'=>12,

                           ),

                       ),

                       array(

                           'match'=>array(

                               'title'=>'xxxx',

                           ),

                       ),

                   ),

              ),

          ),

    ),

);

 

2、一個字段多個值查詢,多個值能夠用,區分it

多個值,分批匹配ast

字段=》rjDetails,sgDetails,presellDetails,beforBgDetails,bgDetailsclass

相關文章
相關標籤/搜索