brighttalk/acs-query-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

brighttalk/acs-query-builder

最新稳定版本:0.5.0

Composer 安装命令:

composer require brighttalk/acs-query-builder

包简介

Provides an object oriented way to programmatically build queries for the Amazon Cloud Search service

README 文档

README

Build Status

Description

This library provides an object oriented way to programmatically build queries for the Amazon Cloud Search service. It's inspired by Doctrine's query builder. A query's __toString method will return a decoded string, as provided by the http_build_query function

##Installation

Add to your composer.json:

"require": {
    ...
    "brighttalk/acs-query-builder": "dev-master"
}

Working with the Query Builder

$query = $qb->searchByFieldValue("fieldName", "'fieldValue'")
    ->setSize(20)
    ->setStart(0)
    ->setRank('-fieldName')
    ->getQuery();

echo $query;

would output bq=fieldName:'fieldValue'&start=0&size=20&rank=-fieldName (the "-" in the rank expression means it is in descending order - see the Amazon docs )

The ExpressionBuilder

The supported expressions are: andX, orX, notX, eq

Example:

$query = $qb->setSearchExpression($qb->expr()->andx(
        $qb->expr()->eq("aFieldName", "'aFieldValue'"),
        $qb->expr()->notx($qb->expr()->eq("anotherFieldName", "'anotherFieldValue'"))
    ))
    ->setSize(20)
    ->setStart(0)
    ->getQuery();

echo $query;

would output bq=(and afieldName:'afieldValue' (not anotherFieldName:'anotherFieldValue'))&start=0&size=20

统计信息

  • 总下载量: 12.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 9
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2013-07-11