trinity/search

Trinity 搜索组件

安装次数: 4,068

依赖: 4

建议者: 0

安全: 0

星星: 1

关注者: 15

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0.4 2017-12-02 18:56 UTC

This package is not auto-updated.

Last update: 2024-09-19 14:16:36 UTC


README

#Trinity 搜索

Coverage Status Build Status

Trinity 搜索是 Trinity 包的一部分。

描述

  • 根据给定查询查找对象数组

基本路由

/admin/search/{entity}/?q=

##语法将查询附加到基本路由。查询可以由以下组成

  • (可选) 列选择 - 将您希望返回的列放入简单括号中。如果您想访问关联表中的列,只需在冒号后加上关联表中列的名称即可
(column1,column2,column3,column4:attributeFromAssociatedTable:anotherAttribute)
  • (可选) 条件 - 将条件放入花括号中。可用运算符:<、>、=、<=、>=、!=、AND、OR
{column1 > 500 AND column2 < 800 OR (column3 = <str>JohnDoe</str> AND column4 <= 20)}
  • 字符串值必须用括号括起来
{name = <str>Jack</str> AND description LIKE <str>%it started as "game"%</str>}
  • (可选) 限制 - 对于限制5行,只需附加
LIMIT=5
  • (可选) 偏移 - 对于偏移10行,只需附加
OFFSET=10
  • (可选) 排序 - 对于排序结果,附加关键字 ORDER BY,然后是您想要排序的列和方向,支持多个列排序 - 用逗号分隔列
ORDERBY column1 ASC, column2 DESC

#####示例

/admin/search/product/?q=
(id,name,defaultBillingPlan:initialPrice)
{defaultBillingPlan:initialPrice > "14"} LIMIT=10 OFFSET=0 ORDERBY clients:name ASC, defaultBillingPlan:initialPrice DESC