小编erc*_*cvs的帖子

Php工匠迁移失败了Laravel

我有以下错误.有人理解为什么?

php工匠迁移

 SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key 
was too long; max key length is 767 bytes (SQL: alter table `users` 
add unique `users_email_unique`(`email`))
Run Code Online (Sandbox Code Playgroud)

create_users_table.php

Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name',255);
    $table->string('email',255)->unique();
    $table->string('password',255);
    $table->rememberToken();
    $table->timestamps();
});
Run Code Online (Sandbox Code Playgroud)

php laravel

5
推荐指数
1
解决办法
636
查看次数

Elasticsearch 多范围错误

我在使用 Elasticsearch 时遇到问题

以下 json 值适用于我的本地服务器,但不适用于远程服务器。

错误:查询不支持多个字段,找到 [日期] 和 [价格]

post.json

{
            "query": {
                "bool": {
                    "must": [
                        {
                            "query_string": {
                                "query": "product:DESKTOP"
                            }
                        },
                        {
                            "range": {
                                "date": {
                                    "gt": "2018-04-24",
                                    "lte": "2018-06-24"
                                },
                                "price": {
                                    "gt": 0,
                                    "lte": 2000
                                }
                            }
                        }
                    ]
                }
            },
            "from": 10,
            "size": 200         }
Run Code Online (Sandbox Code Playgroud)

我哪里错了?谢谢你的回答

json elasticsearch

3
推荐指数
1
解决办法
2091
查看次数

ES Multiple必须查询

我想使用多必须查询,但出现以下错误。重复的键“必须”语法错误。结果应该是幻想和可乐。我如何获得这些数据?

必须类似于以下结果:1:可口可乐2:芬达

  {
    "query": {
      "bool": {
        "must": [
             {
                "match": {
                  "productName":"Coca Cola"
                }
              },
              {
                "match": {
                  "productCode": "Coke"
                }
              },
              {
                "match": {
                  "created_date": "2018-06-10"
                }
              }
        ],
        "must": [
             {
                "match": {
                  "productName":"Fanta"
                }
              },
              {
                "match": {
                  "productCode": "Coke"
                }
              },
              {
                "match": {
                  "created_date": "2018-06-05"
                }
              }
        ]
      }
    }
  }
Run Code Online (Sandbox Code Playgroud)

在mysql中:

选择*从产品所在的位置(名称=“可口可乐”和代码=“可乐” ...)或(名称=“芬达” ...)

elasticsearch

2
推荐指数
1
解决办法
1108
查看次数

标签 统计

elasticsearch ×2

json ×1

laravel ×1

php ×1