修正列表分片

This commit is contained in:
2024-11-05 22:22:56 +08:00
parent da6913eaba
commit 325264ddad
5 changed files with 13 additions and 40 deletions

View File

@@ -400,6 +400,9 @@ func NewSchema(config Config) (graphql.Schema, error) {
if args.Text != "" {
resp, err := models.ZincSearch(map[string]interface{}{
"query": map[string]interface{}{
//"term": map[string]interface{}{
// "text": args.Text,
//},
"bool": map[string]interface{}{
"must": []map[string]interface{}{
{
@@ -505,7 +508,9 @@ func NewSchema(config Config) (graphql.Schema, error) {
}
if args.First == 0 && args.Last == 0 {
list = list[:10]
if len(list) > 10 {
list = list[:10]
}
}
// 存在外部筛选条件