elasticsearch bool query combine must with OR

后端 未结 6 793
小蘑菇
小蘑菇 2020-11-28 00:51

I am currently trying to migrate a solr-based application to elasticsearch.

I have this lucene query

(( 
    name:(+foo +bar) 
    OR info:(+foo +bar         


        
6条回答
  •  无人及你
    2020-11-28 01:22

    $filterQuery = $this->queryFactory->create(QueryInterface::TYPE_BOOL, ['must' => $queries,'should'=>$queriesGeo]);
    

    In must you need to add the query condition array which you want to work with AND and in should you need to add the query condition which you want to work with OR.

    You can check this: https://github.com/Smile-SA/elasticsuite/issues/972

提交回复
热议问题