示例#1
0
文件: Mapper.php 项目: nja78/magento2
    /**
     * Process bool query
     *
     * @param ScoreBuilder $scoreBuilder
     * @param BoolQuery $query
     * @param Select $select
     * @param QueryContainer $queryContainer
     * @return Select
     */
    private function processBoolQuery(
        ScoreBuilder $scoreBuilder,
        BoolQuery $query,
        Select $select,
        QueryContainer $queryContainer
    ) {
        $scoreBuilder->startQuery();

        $select = $this->processBoolQueryCondition(
            $scoreBuilder,
            $query->getMust(),
            $select,
            BoolQuery::QUERY_CONDITION_MUST,
            $queryContainer
        );

        $select = $this->processBoolQueryCondition(
            $scoreBuilder,
            $query->getShould(),
            $select,
            BoolQuery::QUERY_CONDITION_SHOULD,
            $queryContainer
        );

        $select = $this->processBoolQueryCondition(
            $scoreBuilder,
            $query->getMustNot(),
            $select,
            BoolQuery::QUERY_CONDITION_NOT,
            $queryContainer
        );

        $scoreBuilder->endQuery($query->getBoost());

        return $select;
    }
示例#2
0
 /**
  * Process bool query
  *
  * @param ScoreBuilder $scoreBuilder
  * @param BoolQuery $query
  * @param Select $select
  * @return Select
  */
 private function processBoolQuery(ScoreBuilder $scoreBuilder, BoolQuery $query, Select $select)
 {
     $scoreBuilder->startQuery();
     $select = $this->processBoolQueryCondition($scoreBuilder, $query->getMust(), $select, self::BOOL_MUST);
     $select = $this->processBoolQueryCondition($scoreBuilder, $query->getShould(), $select, self::BOOL_MUST);
     $select = $this->processBoolQueryCondition($scoreBuilder, $query->getMustNot(), $select, self::BOOL_MUST_NOT);
     $scoreBuilder->endQuery($query->getBoost());
     return $select;
 }