大家好我正在尝试创建架构测试.
PUT /test
{
"mappings": {
"field1": {
"type": "integer"
},
"field2": {
"type": "integer"
},
"field3": {
"type": "string",
"index": "not_analyzed"
},
"field4": {
"type": "string",
"analyzer": "autocomplete",
"search_analyzer": "standard"
}
},
"settings": {
bla
bla
bla
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
{
"error": {
"root_cause": [{
"type": "mapper_parsing_exception",
"reason": "Root mapping definition has unsupported parameters: [index : not_analyzed] [type : string]"
}],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [featured]: Root mapping definition has unsupported parameters: [index : not_analyzed] [type …Run Code Online (Sandbox Code Playgroud) 我们在索引中有一个字段“名称”。我们最近添加了一个新字段“别名”。我想将名称字段值复制到所有文档的新字段别名。
是否有任何更新查询可以做到这一点?如果那不可能,请帮助我实现这一目标。提前致谢
我正在尝试此查询 http:// URL / index / profile / _update_by_query
{
"query": {
"constant_score" : {
"filter" : {
"exists" : { "field" : "name" }
}
}
},
"script" : "ctx._source.alias = name;"
}
Run Code Online (Sandbox Code Playgroud)
在脚本中,我不确定如何命名字段。我遇到错误
{
"error": {
"root_cause": [
{
"type": "class_cast_exception",
"reason": "java.lang.String cannot be cast to java.util.Map"
}
],
"type": "class_cast_exception",
"reason": "java.lang.String cannot be cast to java.util.Map"
},
"status": 500
}
Run Code Online (Sandbox Code Playgroud) 我们计划使用 Elasticsearch 来存储商家资料详细信息和交易金额摘要。我们必须更新每笔交易的文档以保持总金额同步。
提前致谢。
我正在收集字段dateStr
{ .... "dateStr" : "07/01/2020" .... }
{ .... "dateStr" : "07/01/1970" .... }
Run Code Online (Sandbox Code Playgroud)
我想从dateStr字段按月和年分组
我试过了
db.collection.aggregate(
{$project : {
month : {$month : new Date("$dateStr")},
year : {$year : new Date("$dateStr")}
}},
{$group : {
_id : {month : "$month" ,year : "$year" },
count : {$sum : 1}
}})
Run Code Online (Sandbox Code Playgroud)
输出:
{
"result" : [
{
"_id" : {
"month" : 1,
"year" : 1970
},
"count" : 2
}
],
"ok" : 1
}
Run Code Online (Sandbox Code Playgroud)
但我有两年1970,2020.为什么我会获得单曲?
我们的应用程序需要使用 java 通过 Luna JSP api 与 SafeNet HSM 进行交互。我们尝试了以下操作并能够连接
LunaSlotManager slotManager = LunaSlotManager.getInstance();
slotManager.login(password);
Run Code Online (Sandbox Code Playgroud)
但我的问题是,在我的程序中,我没有给出 HSM 设备的任何 IP 地址。那么它是如何检测并连接的呢?